about summary refs log tree commit diff
path: root/emacs.d/wpc
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2018-09-04T19·01-0400
committerWilliam Carroll <wpcarro@gmail.com>2018-09-04T19·01-0400
commit0244474e9fb6a49ec2d3d555e15e644f12479388 (patch)
tree118c3dfea9dbbb172eadf938a3c42d5019dd9d17 /emacs.d/wpc
parent0d6c0881a81e2ba3a1cd88f8ae9dab6a86c966af (diff)
Debug startup, support LSP, update KBDs
Debug startup:
- some packages were missing explicit use-package calls, which made this
  configuration incompatible with fresh computers. After crashing my MBP
  and trying to get this working thereafter, I learned.

Support LSP:
- LSP support for Haskell is good; embrace and prefer over Intero

Update KBDs:
- preferences change
- changing to a light theme (for now)
Diffstat (limited to 'emacs.d/wpc')
-rw-r--r--emacs.d/wpc/packages/wpc-clojure.el2
-rw-r--r--emacs.d/wpc/packages/wpc-haskell.el21
-rw-r--r--emacs.d/wpc/packages/wpc-keybindings.el15
-rw-r--r--emacs.d/wpc/packages/wpc-misc.el13
-rw-r--r--emacs.d/wpc/packages/wpc-package.el2
-rw-r--r--emacs.d/wpc/packages/wpc-ui.el2
-rw-r--r--emacs.d/wpc/string-functions.el10
7 files changed, 34 insertions, 31 deletions
diff --git a/emacs.d/wpc/packages/wpc-clojure.el b/emacs.d/wpc/packages/wpc-clojure.el
index 3644f76a70e2..611e9bf5efd3 100644
--- a/emacs.d/wpc/packages/wpc-clojure.el
+++ b/emacs.d/wpc/packages/wpc-clojure.el
@@ -50,8 +50,6 @@
    "<up>"   'cider-repl-previous-input
    "<down>" '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 e6525537ba44..8e5dccfeaa9d 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 2c15b0df3a67..a20a803a433b 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 ee80e019abe4..533de61f9540 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 472f9df623a4..844ad83d5328 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 03899e61ba2b..87705cd6c61f 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 91b46b5b409e..a7c4a39c6343 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)