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)
This commit is contained in:
William Carroll 2018-09-04 15:01:07 -04:00
parent 0d6c0881a8
commit 0244474e9f
9 changed files with 53 additions and 33 deletions

View file

@ -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)

View file

@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: Derive Safe Copy
# key: dsc
# --
deriveSafeCopy 0 'base ''$1

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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/")

View file

@ -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))

View file

@ -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)