10

I use evil. Normally, when I commit, I'd like to immediately start typing, but evil starts the buffer in evil-normal-state. I used to set

(evil-set-initial-state #'git-commit-mode 'insert)

But that no longer works, as Magit uses text-mode for its commit buffers.

How can I have Magit commits default to evil-insert-state?

PythonNut
  • 10,243
  • 2
  • 29
  • 75

2 Answers2

12

Here's a workaround:

(add-hook 'with-editor-mode-hook 'evil-insert-state)

I'm not sure why the initial state system was chosen as it either means you have a huge whitelist of states or do lookup of derived modes, the hooks system is a much more natural fit for Evil IMO.

wasamasa
  • 21,803
  • 1
  • 65
  • 97
5

(add-hook 'git-commit-mode-hook 'evil-insert-state) works

David
  • 151
  • 1
  • 2