Skip to content

Commit

Permalink
Text-mode is not a prog-mode, enable evil-mode in text-mode too
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffkreeftmeijer committed May 6, 2024
1 parent 419b378 commit d2cf948
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion default.el
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ end tell"))
(use-package evil
:ensure t
:hook
(prog-mode . turn-on-evil-mode))
(prog-mode . turn-on-evil-mode)
(text-mode . turn-on-evil-mode))

(use-package evil-commentary
:ensure t
Expand Down
4 changes: 3 additions & 1 deletion emacs-configuration.org
Original file line number Diff line number Diff line change
Expand Up @@ -540,17 +540,19 @@ Emacs is the best Vim emulator, and [[https://github.com/emacs-evil/evil][Evil]]
After installing Evil, turn on =evil-mode= globally:

Instead of enabling Evil's gloval ~evil-mode~ hook, turn it on per buffer.
By hooking into /prog-mode/, Evil mode is only turned on for programming buffers.
By hooking into both /prog-mode/ and /text-mode/, Evil mode is only turned on for programming and text editing buffers.

#+begin_src emacs-lisp
(add-hook 'prog-mode-hook 'turn-on-evil-mode)
(add-hook 'text-mode-hook 'turn-on-evil-mode)
#+end_src

#+headers: :eval no
#+headers: :exports none
#+headers: :noweb-ref evil-hook
#+begin_src emacs-lisp
(prog-mode . turn-on-evil-mode)
(text-mode . turn-on-evil-mode)
#+end_src

#+headers: :exports none
Expand Down

0 comments on commit d2cf948

Please sign in to comment.