diff options
author | William Carroll <wpcarro@gmail.com> | 2020-01-20T12·11+0000 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2020-01-22T21·13+0000 |
commit | b4a6551dd5817059b2fff7ca59ce5956f045027d (patch) | |
tree | ee83d786cc7656054f46530995de3ffe8faca2c4 /configs/shared/.emacs.d/wpc/packages | |
parent | 40742c612a59dfad6f6ab21797e2a279be1f1a78 (diff) |
Drop support for evil-leader
Preferring to use the `general` package for defining leader-prefixed keybindings than `evil-leader`. This TODO has existed for quite awhile, so I'm pleased to finish it! During the cleanup, I deleted some keybindings that I no longer used.
Diffstat (limited to 'configs/shared/.emacs.d/wpc/packages')
-rw-r--r-- | configs/shared/.emacs.d/wpc/packages/wpc-javascript.el | 9 | ||||
-rw-r--r-- | configs/shared/.emacs.d/wpc/packages/wpc-keybindings.el | 92 | ||||
-rw-r--r-- | configs/shared/.emacs.d/wpc/packages/wpc-lisp.el | 26 |
3 files changed, 62 insertions, 65 deletions
diff --git a/configs/shared/.emacs.d/wpc/packages/wpc-javascript.el b/configs/shared/.emacs.d/wpc/packages/wpc-javascript.el index bd2b9b49f038..3de9fff3aaa5 100644 --- a/configs/shared/.emacs.d/wpc/packages/wpc-javascript.el +++ b/configs/shared/.emacs.d/wpc/packages/wpc-javascript.el @@ -11,6 +11,10 @@ ;;; Code: +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Configuration +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Constants (defconst wpc/js-hooks '(js-mode-hook web-mode-hook typescript-mode-hook js2-mode-hook rjsx-mode-hook) @@ -26,11 +30,6 @@ js-indent-level 2 css-indent-offset 2) -;; ;; javascript -;; (evil-leader/set-key-for-mode 'rjsx-mode "t" #'wpc/toggle-between-js-test-and-module) -;; (evil-leader/set-key-for-mode 'rjsx-mode "x" #'wpc/toggle-between-js-component-and-store) -;; (evil-leader/set-key-for-mode 'rjsx-mode "u" #'wpc/jump-to-parent-file) - ;; Flow for Javascript (use-package add-node-modules-path :config diff --git a/configs/shared/.emacs.d/wpc/packages/wpc-keybindings.el b/configs/shared/.emacs.d/wpc/packages/wpc-keybindings.el index 2cae7d3f7092..2ff4fe375829 100644 --- a/configs/shared/.emacs.d/wpc/packages/wpc-keybindings.el +++ b/configs/shared/.emacs.d/wpc/packages/wpc-keybindings.el @@ -5,13 +5,18 @@ ;; This module hosts my Evil preferences ;; ;; Wish List: -;; - drop support for `evil-leader' library in favor of `general.el' ;; - restore support for concise (n <kbd> <function>) instead of `general-mmap' ;; - restore support for `general-unbind' ;;; Code: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dependencies +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(require 'general) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Packages ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -86,51 +91,46 @@ ;; kbds for magit is with `evil-magit'. (use-package evil-magit) -;; expose a leader key -(use-package evil-leader - :after (evil) - :config - (global-evil-leader-mode 1) - (evil-leader/set-leader "<SPC>") - (evil-leader/set-key - "i" #'counsel-semantic-or-imenu - "I" #'ibuffer - "hk" #'helpful-callable - "hf" #'helpful-function - "hm" #'helpful-macro - "hc" #'helpful-command - "hk" #'helpful-key - "hv" #'helpful-variable - "hp" #'helpful-at-point - "s" #'flyspell-mode - "S" #'sort-lines - "a" #'wpc-terminal/toggle - "=" #'align - "p" #'flycheck-previous-error - "f" #'wpc/find-file - "n" #'flycheck-next-error - "N" #'smerge-next - "W" #'balance-windows - "gs" #'magit-status - "E" #'refine - - "es" #'wpc/create-snippet - ;; TODO: Replace with `macros/ilambda' when that is working again. - "ev" (lambda () (interactive) (wpc/find-file-split "~/.config/nvim/init.vim")) - "ee" (lambda () (interactive) (wpc/find-file-split "~/.emacs.d/init.el")) - "ez" (lambda () (interactive) (wpc/find-file-split "~/.zshrc")) - "ea" (lambda () (interactive) (wpc/find-file-split "~/aliases.zsh")) - "ef" (lambda () (interactive) (wpc/find-file-split "~/functions.zsh")) - "el" (lambda () (interactive) (wpc/find-file-split "~/variables.zsh")) - "ex" (lambda () (interactive) (wpc/find-file-split "~/.Xresources")) - "em" (lambda () (interactive) (wpc/find-file-split "~/.tmux.conf")) - - "l" #'locate - "L" #'list-packages - "B" #'magit-blame - "w" #'save-buffer - "r" #'wpc/evil-replace-under-point - "R" #'deadgrep)) +;; TODO: Consider moving this to another module. +(general-define-key + :prefix "<SPC>" + :states '(normal) + "i" #'counsel-semantic-or-imenu + "I" #'ibuffer + "hk" #'helpful-callable + "hf" #'helpful-function + "hm" #'helpful-macro + "hc" #'helpful-command + "hk" #'helpful-key + "hv" #'helpful-variable + "hp" #'helpful-at-point + "s" #'flyspell-mode + "S" #'sort-lines + "a" #'wpc-terminal/toggle + "=" #'align + "p" #'flycheck-previous-error + "f" #'wpc/find-file + "n" #'flycheck-next-error + "N" #'smerge-next + "W" #'balance-windows + "gs" #'magit-status + "E" #'refine + "es" #'wpc/create-snippet + ;; TODO: Replace with `macros/ilambda' when that is working again. + "ev" (lambda () (interactive) (wpc/find-file-split "~/.config/nvim/init.vim")) + "ee" (lambda () (interactive) (wpc/find-file-split "~/.emacs.d/init.el")) + "ez" (lambda () (interactive) (wpc/find-file-split "~/.zshrc")) + "ea" (lambda () (interactive) (wpc/find-file-split "~/aliases.zsh")) + "ef" (lambda () (interactive) (wpc/find-file-split "~/functions.zsh")) + "el" (lambda () (interactive) (wpc/find-file-split "~/variables.zsh")) + "ex" (lambda () (interactive) (wpc/find-file-split "~/.Xresources")) + "em" (lambda () (interactive) (wpc/find-file-split "~/.tmux.conf")) + "l" #'locate + "L" #'list-packages + "B" #'magit-blame + "w" #'save-buffer + "r" #'wpc/evil-replace-under-point + "R" #'deadgrep) ;; create comments easily (use-package evil-commentary diff --git a/configs/shared/.emacs.d/wpc/packages/wpc-lisp.el b/configs/shared/.emacs.d/wpc/packages/wpc-lisp.el index 4dff3e452902..6260d8de2cb3 100644 --- a/configs/shared/.emacs.d/wpc/packages/wpc-lisp.el +++ b/configs/shared/.emacs.d/wpc/packages/wpc-lisp.el @@ -8,6 +8,16 @@ ;;; Code: +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dependencies +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(require 'general) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Configuration +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (defconst wpc/lisp-mode-hooks '(lisp-mode-hook emacs-lisp-mode-hook @@ -92,24 +102,12 @@ :config (general-add-hook 'emacs-lisp-mode #'ielm-mode)) -;; TODO: Should I be using `general-define-key' or `evil-leader/set-key'? My -;; gut say `general-define-key'. (general-define-key :keymaps 'emacs-lisp-mode-map - :states 'normal :prefix "<SPC>" - "x" #'eval-defun) - -(general-define-key - :keymaps 'emacs-lisp-mode-map :states 'normal - :prefix "<SPC>" - "X" #'eval-buffer) - -(general-define-key - :keymaps 'emacs-lisp-mode-map - :states 'normal - :prefix "<SPC>" + "x" #'eval-defun + "X" #'eval-buffer "d" (lambda () (interactive) (with-current-buffer (current-buffer) |