Start evil mode in insert for some buffers

2019-08-02 20:28发布

I would like to set some buffers to be opened in insert mode in evil.

For example in read-only buffers there is no point in having a normal mode since i then can't use q to exit but i have to do i q. This is annoying for interactive modes that produce error buffers.

What I have been trying and failed with is as follows:

(evil-set-initial-state view-mode 'insert)

1条回答
叼着烟拽天下
2楼-- · 2019-08-02 21:00

You can modify the variable evil-insert-state-modes, which holds a list of modes that should be started in insert state:

(add-to-list 'evil-insert-state-modes 'view-mode)

There are analogous variables for emacs state, normal state, etc.

查看更多
登录 后发表回答