I often just need to create a notes.txt file in Windows to just quickly paste some text from some other place, save it from the gvim UI, and close the file. I want to be able to perform this operation quickly without having to press i on the keyboard, and gvim is my editor of choice on Windows and all files with the .txt extension have been associated with gvim.

So, I want to configure my _Vimrc so that when a .txt file is opened, insert mode is enabled by default. For other files, if at all possible, starting in command mode is preferable as I often start a gvim session by jumping to a line number in command mode.

If the above is not possible, then how can I simply configure gvim to start in insert mode?


  • Sort of a dupe, but the other qu. is more about *nix than Windows
    – roblogic
    Feb 26, 2015 at 3:24

1 Answer 1


This should do it:

autocmd BufRead *.txt startinsert

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