diff --git a/emacs.d/init.el b/emacs.d/init.el index b2fb4cfa3..8f0deff07 100644 --- a/emacs.d/init.el +++ b/emacs.d/init.el @@ -1,12 +1,25 @@ + +;; Added by Package.el. This must come before configurations of +;; installed packages. Don't delete this line. If you don't want it, +;; just comment it out by adding a semicolon to the start of the line. +;; You may delete these explanatory comments. +(package-initialize) + (require 'wpc-package "~/.emacs.d/wpc/packages/wpc-package.el") ;; third-party libraries (use-package dash) +(use-package dash-functional) (use-package s) (use-package f) +(use-package request) +(use-package pcre2el) + +;; load order is intentional +(require 'variables) +(require 'wpc-misc) ;; my libraries -(require 'variables) (require 'functions) (require 'string-functions) (require 'macros) @@ -14,7 +27,6 @@ (require 'wpc-ui) (require 'wpc-keybindings) -(require 'wpc-misc) (require 'wpc-dired) (require 'wpc-terminal) (require 'wpc-org) diff --git a/emacs.d/snippets/haskell-mode/derive-safe-copy b/emacs.d/snippets/haskell-mode/derive-safe-copy new file mode 100644 index 000000000..95f7d9dee --- /dev/null +++ b/emacs.d/snippets/haskell-mode/derive-safe-copy @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: Derive Safe Copy +# key: dsc +# -- +deriveSafeCopy 0 'base ''$1 \ No newline at end of file diff --git a/emacs.d/wpc/packages/wpc-clojure.el b/emacs.d/wpc/packages/wpc-clojure.el index 3644f76a7..611e9bf5e 100644 --- a/emacs.d/wpc/packages/wpc-clojure.el +++ b/emacs.d/wpc/packages/wpc-clojure.el @@ -50,8 +50,6 @@ "" 'cider-repl-previous-input "" 'cider-repl-next-input "C-c 'j" 'wpc/find-or-create-clojure-or-clojurescript-repl) - (n - "M-." 'cider-find-var) :config (setq cider-cljs-lein-repl "(do (require 'figwheel-sidecar.repl-api) diff --git a/emacs.d/wpc/packages/wpc-haskell.el b/emacs.d/wpc/packages/wpc-haskell.el index e6525537b..8e5dccfea 100644 --- a/emacs.d/wpc/packages/wpc-haskell.el +++ b/emacs.d/wpc/packages/wpc-haskell.el @@ -7,21 +7,10 @@ ;;; Code: ;; Haskell support -(use-package intero - :config - (intero-global-mode 1)) - -;; text objects for Haskell -(quelpa '(evil-text-objects-haskell - :fetcher github - :repo "urbint/evil-text-objects-haskell")) -(require 'evil-text-objects-haskell) +;; font-locking, glyph support, etc (use-package haskell-mode - :gfhook #'evil-text-objects-haskell/install - :after (intero evil-text-objects-haskell) :config - (flycheck-add-next-checker 'intero 'haskell-hlint) (let ((m-symbols '(("`mappend`" . "⊕") ("<>" . "⊕")))) @@ -29,7 +18,15 @@ (setq haskell-font-lock-symbols t) (add-hook 'before-save-hook #'haskell-align-imports)) +;; LSP support +(use-package lsp-haskell + :after (haskell-mode) + :config + (setq lsp-haskell-process-path-hie "hie-wrapper") + (add-hook 'haskell-mode-hook #'lsp-haskell-enable) + (add-hook 'haskell-mode-hook #'flycheck-mode)) +;; Test toggling (defun empire/haskell/module->test () "Jump from a module to a test." (let ((filename (->> buffer-file-name diff --git a/emacs.d/wpc/packages/wpc-keybindings.el b/emacs.d/wpc/packages/wpc-keybindings.el index 2c15b0df3..a20a803a4 100644 --- a/emacs.d/wpc/packages/wpc-keybindings.el +++ b/emacs.d/wpc/packages/wpc-keybindings.el @@ -12,17 +12,6 @@ :fetcher github)) (general-evil-setup t) -(defun wpc/goto-definition () - "Support a goto-definition that dispatches off of the `major-mode'." - (interactive) - (require 'flow-minor-mode) - (cond ((eq major-mode 'rjsx-mode) - (flow-minor-jump-to-definition)) - ((eq major-mode 'haskell-mode) - (intero-goto-definition)) - (t - (evil-goto-definition)))) - ;; vim... (use-package evil :general @@ -37,7 +26,7 @@ "sj" 'wpc/evil-window-split-down "sj" 'wpc/evil-window-split-down) (n - "gd" 'wpc/goto-definition) + "gd" 'xref-find-definitions) (general-unbind m "M-." "C-p") (general-unbind n "s" "M-.") (general-unbind i "C-d" "C-a" "C-e" "C-n" "C-p" "C-k") @@ -68,7 +57,7 @@ "j" #'jump-to-register "h" #'help "a" #'wpc/toggle-terminal - "p" #'counsel-git-grep + "p" #'flycheck-previous-error "P" #'counsel-git-grep "f" #'wpc/find-file "n" #'flycheck-next-error diff --git a/emacs.d/wpc/packages/wpc-misc.el b/emacs.d/wpc/packages/wpc-misc.el index ee80e019a..533de61f9 100644 --- a/emacs.d/wpc/packages/wpc-misc.el +++ b/emacs.d/wpc/packages/wpc-misc.el @@ -33,7 +33,7 @@ (set-register ?e '(file . "~/.emacs.d/wpc/packages")) (set-register ?u '(file . "~/urbint")) (set-register ?d '(file . "~/dotfiles")) -(set-register ?s '(file . "~/dotfiles/configs/os_x/.slate.js")) +(set-register ?s '(file . "~/.slate.js")) (set-register ?D '(file . "~/Dropbox")) (set-register ?o '(file . "~/Dropbox/org/")) (set-register ?c '(file . "~/Dropbox/org/chains.org")) @@ -155,5 +155,14 @@ (use-package markdown-mode) (use-package yaml-mode) +;; Microsoft's Language Server Protocol (LSP) +(use-package lsp-mode) +(use-package lsp-ui + :config + (add-hook 'lsp-mode-hook #'lsp-ui-mode)) +(use-package company-lsp + :config + (push 'company-lsp company-backends)) + (provide 'wpc-misc) -;;; misc.el ends here +;;; wpc-misc.el ends here diff --git a/emacs.d/wpc/packages/wpc-package.el b/emacs.d/wpc/packages/wpc-package.el index 472f9df62..844ad83d5 100644 --- a/emacs.d/wpc/packages/wpc-package.el +++ b/emacs.d/wpc/packages/wpc-package.el @@ -22,7 +22,7 @@ (setq use-package-always-ensure t) ;; Remove this line once general integration with use-package calls ;; with-eval-after-load 'use-package-core instead of 'use-package -(require 'general) +(use-package general) (add-to-list 'load-path "~/.emacs.d/vendor/") (add-to-list 'load-path "~/.emacs.d/wpc/") diff --git a/emacs.d/wpc/packages/wpc-ui.el b/emacs.d/wpc/packages/wpc-ui.el index 03899e61b..87705cd6c 100644 --- a/emacs.d/wpc/packages/wpc-ui.el +++ b/emacs.d/wpc/packages/wpc-ui.el @@ -95,7 +95,7 @@ :config (setq doom-themes-enable-bold t doom-themes-enable-italic t) - (load-theme 'doom-one t) + (load-theme 'doom-one-light t) (doom-themes-visual-bell-config) (doom-themes-org-config)) diff --git a/emacs.d/wpc/string-functions.el b/emacs.d/wpc/string-functions.el index 91b46b5b4..a7c4a39c6 100644 --- a/emacs.d/wpc/string-functions.el +++ b/emacs.d/wpc/string-functions.el @@ -14,6 +14,16 @@ "Append \"-hook\" to X." (s-append "-hook" x)) +(defun symbol->string (symbol) + "Alias for `symbol-name' with SYMBOL, since I can never remember that +function's name." + (symbol-name symbol)) + +(defun string->symbol (string) + "Alias for `intern' for STRING since I can never remember that function's + name." + (intern string)) + (defun string/ensure-hookified (x) "Ensure that X has \"-hook\" appended to it." (if (s-ends-with? "-hook" x)