New answers tagged

2

:r inserts the contents of a file. It does not overwrite existing contents. Since a new file opened in Vim can't have zero lines* you'll be adding the file's contents to one blank line. Simplest thing to do is just add an additional command to your autocommand: autocmd BufNewFile *.cpp 0r C:\Users\User\Desktop\cp\Template.cpp | $d So we use | to indicate an ...


Top 50 recent answers are included