2

How do I make vim open files in insert mode? I've got the line "startinsert" in my .vimrc, and it does what it's supposed to (vim opens in insert mode), but when I open another file it opens it in command mode. I've played around with autocmd with no luck.Any ideas?

2

2 Answers 2

1

The way you did it, your command is only read and applyied once, when vim starts.

To get the behaviour you expect, you need to apply it to each buffer you open.

This can be done with an :h autocmd.

For example:

augroup OpenEveryBufferInInsertMode
    autocmd!
    autocmd BufRead,BufEnter * startinsert
augroup end
0

Type :set insertmode or run vim -y or copy/symlink/rename vim executable to evim.

Or better switch to Emacs. If you're not going to work in Normal mode then Vim is not a right choice for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.