Start evil mode in insert for some buffers

守給你的承諾、 提交于 2019-12-24 11:49:15

问题


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:


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.



来源:https://stackoverflow.com/questions/26547567/start-evil-mode-in-insert-for-some-buffers

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!