Is there a way to change vim's default mode

2019-06-16 17:58发布

问题:

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

回答1:

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.



回答2:

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



回答3:

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.



回答4:

"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



回答5:

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.



标签: linux shell vim