From eafb0189507af225a9419ea5a66eb90f059f12cf Mon Sep 17 00:00:00 2001 From: Christopher James Hayward Date: Sun, 7 Mar 2021 10:13:53 -0500 Subject: [PATCH] Add visual line modes with evil --- modules/editor.org | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/editor.org b/modules/editor.org index e2bd4d2..eab28ef 100644 --- a/modules/editor.org +++ b/modules/editor.org @@ -33,11 +33,15 @@ Emacs has *a lot of keybindings*, sometimes it's useful to just start mashing ke Emacs has *some strange default keybindings*, they're not like any other editor you've likely ever used. To overcome this nearly show-stopping hurdle, we turn Emacs into Vim[fn:1] with *Evil Mode - The Extensible VI Layer for Emacs*[fn:2]. ++ Enable visual line motions outside of ~visual-line-mode~ buffers + #+begin_src emacs-lisp (use-package evil :custom (evil-want-integration t) ;; Required for `evil-collection'. (evil-want-keybinding nil) ;; Same as above - :config (evil-mode +1)) + :config (evil-global-set-key 'motion "j" 'evil-next-visual-line) + (evil-global-set-key 'motion "k" 'evil-previous-visual-line) + (evil-mode +1)) #+end_src While covering substantial ground towards our goal, the default keybindings implemented in *Evil*[fn:2] alone are *lacking* compared to what you would expect from *Vim*[fn:1]. There's, of course, a communicated curated package *evil-collection*[fn:6] that does a much better job implementing the proper keybindings. @@ -86,6 +90,7 @@ If you're like me and started with Emacs using a framework like *Doom*[fn:3] or :global-prefix dotfiles/leader-key-global)) #+end_src + ** Transient bindings Create transient keybindings with a shared prefix through *Hydra*[fn:10]. This is also used by a number of third-party packages as a completion system. An implementation example is available in the *Font* section of the [[file:interface.org][Interface]] module.