Various changes

This commit is contained in:
Frederik Hanghøj Iversen 2020-02-13 16:42:25 +01:00
parent 1ecf7ef5de
commit 4c14a4131c
3 changed files with 164 additions and 13 deletions

View file

@ -13,7 +13,34 @@
(defvar
haskell-language-extensions
(quote ("UnicodeSyntax" "TypeApplications" "OverloadedStrings" "LambdaCase" "StandaloneDeriving" "DerivingStrategies" "DeriveGeneric" "DeriveAnyClass" "KindSignatures" "DerivingVia" "ConstraintKinds" "FlexibleContexts" "GeneralizedNewtypeDeriving" "ExplicitForAll" "ScopedTypeVariables"))
(quote
("ConstraintKinds"
"DeriveAnyClass"
"DeriveGeneric"
"DerivingStrategies"
;; "DerivingVia"
"EmptyCase"
"ExplicitForAll"
"FlexibleContexts"
"FlexibleInstances"
"GADTs"
"GeneralizedNewtypeDeriving"
"KindSignatures"
"LambdaCase"
"MultiParamTypeClasses"
"MultiWayIf"
"NamedFieldPuns"
"NamedWildCards"
"OverloadedStrings"
"RecordWildCards"
"ScopedTypeVariables"
"StandaloneDeriving"
"TupleSections"
"TypeApplications"
"TypeFamilies"
"TypeSynonymInstances"
"UnicodeSyntax"
"ViewPatterns"))
"List of enabled Haskell language extensions.")
(custom-set-variables
@ -27,11 +54,16 @@
'(blink-cursor-mode nil)
'(column-number-mode t)
'(company-tooltip-minimum-width 35)
'(compilation-disable-input t)
'(confirm-kill-emacs (quote yes-or-no-p))
'(css-indent-offset 2)
'(custom-safe-themes
(quote
("224f84d5013ad0b98a43c54683302309a7cba53c0e37480a65284fd365774400" "d59e18ab7969fd68103ab0fe07e03c1830fd77c21c12a3fb4fe970931ddaf68d" "670df6cad1a732850a5d90ce2b0326969bd7596881dc1fed6b35091520a3da97" "aa81baddda211ffab84a5dc68750ac519d4841be63907a6b5de0cd72e631b172" "c91a5bf65b3f79ab28ab350b1d16c24d8b8bc1201e9c6c2106a60f98bceae754" default)))
'(dashboard-set-footer nil)
'(delete-selection-mode t)
'(dhall-repl-executable "dhall-repl")
'(dhall-use-header-line nil)
'(dired-isearch-filenames t)
'(display-buffer-alist
(quote
@ -72,7 +104,10 @@
'(initial-scratch-message nil)
'(js-indent-level 2)
'(js2-basic-offset 2)
'(js2-global-externs (list (quote this)))
'(kill-whole-line t)
'(line-move-visual nil)
'(lsp-auto-guess-root t)
'(magit-display-buffer-function (quote magit-display-buffer-same-window-except-diff-v1))
'(magit-popup-display-buffer-action nil)
'(markdown-command "pandoc -t html")
@ -81,7 +116,8 @@
'(org-agenda-files "~/.config/orgmode/agenda_files")
'(package-selected-packages
(quote
(prettier-js quelpa typescript-mode visual-fill-column ag ripgrep fill-column-indicator rjsx-mode image+ company org-jira which-key flycheck es-mode lsp-haskell forge projectile exec-path-from-shell lsp-ui lsp-mode editorconfig purescript-mode markdown-mode+ ssh-agency dash yaml-mode restart-emacs markdown-mode magit helm haskell-mode haml-mode form-feed dashboard)))
(origami dhall-mode docker-tramp graphql-mode enh-ruby-mode scala-mode string-inflection prettier-js quelpa typescript-mode visual-fill-column ag ripgrep fill-column-indicator rjsx-mode image+ company org-jira which-key flycheck es-mode lsp-haskell forge projectile exec-path-from-shell lsp-ui lsp-mode editorconfig purescript-mode markdown-mode+ ssh-agency dash yaml-mode restart-emacs markdown-mode magit helm haskell-mode haml-mode form-feed dashboard)))
'(prettier-js-command "prettier-1.18.2")
'(projectile-globally-ignored-directories
(quote
(".idea" ".ensime_cache" ".eunit" ".git" ".hg" ".fslckout" "_FOSSIL_" ".bzr" "_darcs" ".tox" ".svn" ".stack-work" "node_modules" "vendor")))
@ -100,9 +136,42 @@
'(ruby-align-to-stmt-keywords t)
'(ruby-chained-calls t)
'(ruby-insert-encoding-magic-comment nil)
'(safe-local-eval-forms
(quote
((add-hook
(quote write-file-hooks)
(quote time-stamp))
(add-hook
(quote write-file-functions)
(quote time-stamp))
(add-hook
(quote before-save-hook)
(quote time-stamp)
nil t)
(add-hook
(quote before-save-hook)
(quote delete-trailing-whitespace)
nil t)
(format "cd ~/git/zendesk/guide-acceptance-tests && rspec --no-color '%s'"
(projectile-get-relative-path-buffer)))))
'(safe-local-variable-values
(quote
((setq magit-refresh-verbose 1)
((compilation-disable-input . t)
(sgml-basic-offset . 2)
(electric-indent-mode)
(eval add-hook
(quote js2-mode-hook)
(prettier-js-mode 0))
(eval add-hook
(quote js-mode-hook)
(prettier-js-mode 0))
(js-mode
((prettier-js-mode . 0)))
(prettier-js-mode . 0)
(chruby-use . "2.5.5")
(magit-git-debug . 1)
(magit-refresh-verbose . 1)
(setq magit-refresh-verbose 1)
(eval remove-hook
(quote magit-refs-sections-hook)
(quote magit-insert-tags))
@ -118,13 +187,14 @@
'(select-enable-clipboard t)
'(send-mail-function (quote smtpmail-send-it))
'(set-mark-command-repeat-pop t)
'(sgml-basic-offset 2)
'(sgml-basic-offset 1)
'(show-paren-mode t)
'(shr-width 80)
'(split-window-keep-point nil)
'(tags-add-tables t)
'(temp-buffer-resize-mode nil)
'(tool-bar-mode nil)
'(typescript-indent-level 2)
'(vc-follow-symlinks nil)
'(window-combination-resize t)
'(window-resize-pixelwise t))
@ -167,7 +237,11 @@
;; (org-jira . "org-jira/")
(jira . "jira/")
(spark . "spark/")
(chruby . "chruby/")))
(chruby . "chruby/")
(ruby-trace-mode . "ruby-trace-mode/")
(js2-globals . "js2-globals/")
(datadog . "datadog/")
(zdi . "zdi/")))
(defun load-additional-packages ()
"Load the additional packages as specified by additional-packages."
@ -195,6 +269,14 @@
;; (add-hook 'lsp-mode-hook 'lsp-ui-mode)
;; (add-hook 'haskell-mode-hook #'lsp)
;; (require 'lsp-mode)
;; (add-hook 'haskell-mode-hook #'lsp)
;; (setq lsp-prefer-flymake nil)
;; (require 'lsp-ui)
;; (lsp-ui-flycheck-enable t)
;; (require 'lsp-haskell)
;;;; Faces
@ -204,8 +286,15 @@
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(enh-ruby-heredoc-delimiter-face ((t (:inherit font-lock-string-face))))
'(enh-ruby-op-face ((t (:inherit font-lock-variable-name-face))))
'(enh-ruby-string-delimiter-face ((t (:inherit font-lock-string-face))))
'(erm-syn-errline ((t (:inherit flycheck-error))))
'(erm-syn-warnline ((t (:inherit flycheck-warning))))
'(fixed-pitch-serif ((t (:family "Monospace Serif"))))
'(font-lock-comment-face ((t (:foreground "chocolate1"))))
'(magit-diff-hunk-heading ((t (:inherit lazy-highlight))))
'(magit-diff-hunk-heading-highlight ((t (:inherit highlight))))
'(region ((t (:background "#285b89"))))
'(success ((t (:foreground "Green3" :weight bold)))))
@ -214,6 +303,7 @@
(global-set-key (kbd "C-x C-r") 'recentf-open-files)
(global-unset-key (kbd "s-q"))
(global-unset-key (kbd "C-x C-l")) ;; downcase-region
(global-set-key (kbd "C-x r v") 'revert-buffer)
@ -223,6 +313,10 @@
(recentf-mode)
(flyspell-mode)))
(add-hook 'yaml-mode-hook
(lambda ()
(flyspell-mode -1)))
(add-hook 'html-mode-hook
(lambda ()
(flyspell-mode -1)))
@ -230,13 +324,13 @@
(add-hook 'prog-mode-hook
(lambda ()
(form-feed-mode)
(flycheck-mode)))
(flycheck-mode 1)))
;; I think this breaks e.g. the color-picker
; (add-hook 'text-mode-hook 'form-feed-mode)
(add-hook 'haskell-mode-hook (lambda ()
(subword-mode t)
(interactive-haskell-mode t)))
(add-hook 'ruby-mode-hook (lambda () (subword-mode t)))
;; global-company-mode keeps recentering the point on the screen for
;; some reason
; (add-hook 'after-init-hook 'global-company-mode)
@ -249,7 +343,24 @@
(add-hook
'js-mode-hook
(lambda ()
(subword-mode t)))
(subword-mode t)
(prettier-js-mode 1)))
(add-hook
'js2-mode-hook
(lambda ()
(local-set-key (kbd "C-c F n") 'js2-next-error)
(local-set-key (kbd "C-c F l") 'js2-display-error-list)
(prettier-js-mode 1)))
(require 'js2-globals)
(require 'js2-mode)
(setq js2-global-externs js2-globals)
(require 'origami)
(global-origami-mode)
(global-set-key (kbd "C-c o o") 'origami-recursively-toggle-node)
;;;; Projectile
@ -300,6 +411,12 @@
;;;; Ruby
(require 'ruby-mode)
(require 'enh-ruby-mode)
(require 'grep)
;; (add-to-list 'semantic-symref-filepattern-alist '(enh-ruby-mode "*.r[bu]" "*.rake" "*.gemspec" "*.erb" "*.haml" "Rakefile" "Thorfile" "Capfile" "Guardfile" "Vagrantfile"))
(add-to-list 'auto-mode-alist '("\\.rb\\'" . enh-ruby-mode))
(add-to-list 'auto-mode-alist '("\\.hbs\\'" . html-mode))
;; I'm confused about the less worse option here. I think the best
;; option is to use smie (the default).
@ -310,10 +427,27 @@
(setq select-enable-clipboard t)
(add-hook 'ruby-mode-hook '(lambda ()
(local-set-key (kbd "C-M-n") 'ruby-forward-sexp)
(local-set-key (kbd "C-M-p") 'ruby-backward-sexp)
(chruby-use-corresponding)))
(defun fredefox-ruby-mode-hook ()
"Hook to run engaging 'ruby-mode'."
(chruby-use-corresponding)
(subword-mode t)
(zdi-set-compile-command))
(add-hook 'ruby-mode-hook
'(lambda ()
(local-set-key (kbd "C-M-n") 'ruby-forward-sexp)
(local-set-key (kbd "C-M-p") 'ruby-backward-sexp)
(fredefox-ruby-mode-hook)))
(add-hook 'enh-ruby-mode-hook
'(lambda ()
(advice-add 'forward-list :override 'enh-ruby-end-of-block)
(advice-add 'backward-list :override 'enh-ruby-beginning-of-block)
(fredefox-ruby-mode-hook)))
;; '(lambda ()
;; (local-set-key (kbd "C-M-n") 'ruby-forward-sexp)
;; (local-set-key (kbd "C-M-p") 'ruby-backward-sexp)
;; (chruby-use-corresponding)))
(defun sql-beautify-region (beg end)
"Beautify SQL in region between BEG and END.
@ -353,4 +487,20 @@ npm i -g sql-formatter-cli"
(define-key flycheck-mode-map flycheck-keymap-prefix
flycheck-command-map)
(global-set-key (kbd "M-\"") 'insert-pair)
(global-set-key (kbd "M-'") 'insert-pair)
(defun sql-prettyprint (beg end)
"Reformats SQL syntax in region (BEG to END).
Requires that `sqlformat` is installed."
(interactive "r")
(shell-command-on-region beg end "sqlformat --reindent /dev/stdin" nil t))
(add-hook 'dired-mode-hook
(lambda ()
(dired-hide-details-mode 1)))
(defalias 'yes-or-no-p 'y-or-n-p)
;;; init.el ends here

View file

@ -18,3 +18,4 @@ XSERVERRC="$XDG_CONFIG_HOME/X11/xserverrc"
HOMEBREW_NO_AUTO_UPDATE=1
LANG=en_US.UTF-8
PATH="$PATH:~/.local/bin"
ZLE=complete-word

2
ghci
View file

@ -44,7 +44,7 @@
:set -fdefer-type-errors
:set -fno-show-valid-substitutions
:set -fmax-valid-substitutions=0
:set -fprint-unicode-syntax
-- :set -fprint-unicode-syntax
:set -Wincomplete-patterns
:set -Wcompat
:set prompt "λ "