I would like help with my vim script. thus far I am able to check for the file name, however, I have been unsuccessful in learning how to give normal mode commands via vim script. here is what I've got:
autocmd VimEnter * if @% == 'diary.md' | :r! | endif
I am trying to give the command :r! to add the date/time on a new line when I open this file.
I appreciate any and all wisdom, thanks~!
From vi.stackexchange.com, a seemingly easy answer:
You just have to use the filename, the zero indicates the very beginning of the file. If you want to modificate the timestamp just read the
strftimehelp for that.