Drop use-package in keybindings.el

I'm attempting to kill that zombie bug about evil-want-keybinding...
This commit is contained in:
William Carroll 2020-08-19 16:34:30 +01:00
parent 39622607ff
commit 53be40b1a6

View file

@ -29,18 +29,18 @@
(require 'buffer) (require 'buffer)
(require 'display) (require 'display)
(require 'device) (require 'device)
(require 'evil-ex)
(use-package evil ;; Note: The following lines must be sorted this way.
:init
;; Should remove the warning messages on init.
(setq evil-want-integration t) (setq evil-want-integration t)
;; TODO: Troubleshoot why this binding causes the following warning:
;; "Warning (evil-collection): `evil-want-keybinding' was set to nil but not
;; before loading evil."
(setq evil-want-keybinding nil) (setq evil-want-keybinding nil)
(general-evil-setup) (general-evil-setup)
:config (require 'evil)
(require 'evil-collection)
(require 'evil-magit)
(require 'evil-commentary)
(require 'evil-surround)
(require 'key-chord)
;; Ensure that evil's command mode behaves with readline bindings. ;; Ensure that evil's command mode behaves with readline bindings.
(general-define-key (general-define-key
:keymaps 'evil-ex-completion-map :keymaps 'evil-ex-completion-map
@ -56,8 +56,7 @@
"M-d" #'kill-word "M-d" #'kill-word
"M-DEL" #'backward-kill-word "M-DEL" #'backward-kill-word
"C-b" #'backward-char) "C-b" #'backward-char)
;; TODO: Ensure all of my custom keybindings end up in a single map that is
;; easy to enable or disable.
(general-mmap (general-mmap
:keymaps 'override :keymaps 'override
"RET" #'evil-goto-line "RET" #'evil-goto-line
@ -69,6 +68,7 @@
"sh" #'evil-window-vsplit "sh" #'evil-window-vsplit
"sk" #'evil-window-split "sk" #'evil-window-split
"sj" #'wpc/evil-window-split-down) "sj" #'wpc/evil-window-split-down)
(general-nmap (general-nmap
:keymaps 'override :keymaps 'override
"gd" #'xref-find-definitions "gd" #'xref-find-definitions
@ -81,11 +81,16 @@
(interactive) (interactive)
(let ((xref-prompt-for-identifier nil)) (let ((xref-prompt-for-identifier nil))
(call-interactively #'xref-find-references)))) (call-interactively #'xref-find-references))))
(general-unbind 'motion "M-." "C-p" "<SPC>") (general-unbind 'motion "M-." "C-p" "<SPC>")
(general-unbind 'normal "s" "M-." "C-p" "C-n") (general-unbind 'normal "s" "M-." "C-p" "C-n")
(general-unbind 'insert "C-v" "C-d" "C-a" "C-e" "C-n" "C-p" "C-k") (general-unbind 'insert "C-v" "C-d" "C-a" "C-e" "C-n" "C-p" "C-k")
(setq evil-symbol-word-search t) (setq evil-symbol-word-search t)
(evil-mode 1)) (evil-mode 1)
(evil-collection-init)
(evil-commentary-mode)
(global-evil-surround-mode 1)
;; Ensure the Evil search results get centered vertically. ;; Ensure the Evil search results get centered vertically.
(progn (progn
@ -99,29 +104,8 @@
(after advice-for-evil-search-previous activate) (after advice-for-evil-search-previous activate)
(evil-scroll-line-to-center (line-number-at-pos)))) (evil-scroll-line-to-center (line-number-at-pos))))
(use-package evil-collection
:after (evil)
:config
(evil-collection-init))
(use-package evil-magit)
;; create comments easily
(use-package evil-commentary
:after (evil)
:config
(evil-commentary-mode))
(use-package evil-surround
:after (evil)
:config
(global-evil-surround-mode 1))
(use-package key-chord
:after (evil)
:config
(key-chord-mode 1) (key-chord-mode 1)
(key-chord-define evil-insert-state-map "jk" 'evil-normal-state)) (key-chord-define evil-insert-state-map "jk" 'evil-normal-state)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; General KBDs ;; General KBDs