Is there a way to change vim's default mode

2019-06-16 18:24发布

Does anyone know how to change vim's default mode? Its default mode is command mode, but could I change it to insert mode?

标签: linux shell vim
5条回答
forever°为你锁心
2楼-- · 2019-06-16 18:45

Just add the following line to your vimrc:

start

Vim's default mode will be changed to Insert mode. Just press Esc to enter Command mode.

查看更多
手持菜刀,她持情操
3楼-- · 2019-06-16 18:49

You can try the 'insertmode' option (add set insertmode to your .vimrc file), although I recommend that you learn the standard vi operation, because not all vi-like editors support this mode of work.

cheers, mitch

查看更多
看我几分像从前
4楼-- · 2019-06-16 18:52

If you really want an editor that starts out in insert mode, perhaps vim is not the editor for you.

Most editors that aren't based on vi behave the way you want. Emacs is very powerful, but it may be too complicated for your needs. Nano (man nano for info nano for more information) might be a good choice. There are other possibilities.

vim really isn't designed to be used that way. As others have said, there are ways to force it to start up in insert mode. (I've been using vi-style editors for decades, and I didn't even know about :set insertmode until now.) But it's awkward to use.

My advice: either (1) use an editor that behaves the way you want, or (2) spend some time learning to use vim in its default configuration, and see if you can get used to it.

One big advantage of vim's separation of insert and command modes is that the command mode can use letters as commands; modeless editors generally have to use control keys or function keys to execute commands.

查看更多
forever°为你锁心
5楼-- · 2019-06-16 19:01

You can use

vi -cstartinsert

or

vi -cstart

That launch vi and put it insert mode. You can do an alias to that if it's really usefull (I still understand why you want that anyway). You can also look at this tip.

查看更多
对你真心纯属浪费
6楼-- · 2019-06-16 19:04

"Cream" is a project that aims to make Vim easier to use. By default everything you do in Cream is in insert mode, I believe:

http://en.wikipedia.org/wiki/Cream_%28software%29

查看更多
登录 后发表回答