vim "+norm Go" "+startinsert" $filename

7 October 2025, 1 minute

Use the command

vim "+norm Go" "+startinsert" $filename

to automatically move at the end of the file and start editing.

This is useful when you are invoking vim from another script i.e. when you don't want this to be the default behaviour but want it in a special case.

For me this was useful for my journal script which appends the current time at the end of a file and opens the file and (now) automatically moves to the end and goes to insert mode.

vim-tricks neovim vim lifehacks tech
END