I keep a sys.md
file where I record a dated entry of every modification I make to my system (mostly installations of software, sometimes configuration changes) and based on an old Hacker News link about a did file I came up with the idea of an alias that would auto-insert the date and set me up with exactly the prompt I want for an entry to sys.md
.
This command opens my sys.md
file and inserts the date and the bottom:
nvim +'normal Go' +r!date' ~/notes/sys.md
I want to copy that line, paste it below, replace it with -
's as a markdown h2 heading, insert a new line and begin it with a dash-space -_
to start a bullet.
yypVr-o-_
However,
nvim +'normal Go' +'r!date' -c 'yypVr-o-_' ~/notes/sys.md
does not work. How can I auto-execute those commands?
vim +'$pu_|r!date' +'norm yypVr-o-_' foo.txt
? I think you are missing your:normal
command. See:h :norm
nvim +'normal Go' +'r!date' +'yypVr-o-_' ~/notes/sys.md
Because the BASH aliasing system didn't like your$pu_
, but the+'norm <commands>'
synax was what I was looking for anyway. Thank you!:put
with the black hole register,"_
, will create a blank line. Providing a range of$
will mean we put a blank line at the end of the file. See:h :range
,:h quote_
, and:h :put