Abstract: Remember to escape the percent sign
I find that I cannot simply prefix a r!
before plain date command to insert a date in VIM today, When I tried to insert date with
:r !date +%u
I got an error, the reason lies in the percent sign, which stands for the current file in VIM ex-mode. For example, you can count the current file like this:
:! wc %
Thus to insert a formatted date, you have to run:
:r !date +\%u
No comments:
Post a Comment