[sf-lug] entering dates in vim text editor

Rick Moen rick at linuxmafia.com
Mon Nov 16 15:21:47 PST 2020


Quoting alexkleider (alexkleider at protonmail.com):

> While editing a file using vim the following:
> !!date
> results in the date being inserted.
> Although the following at the command line:
> $ date +%c
> works as expected,
> within vim
> !!date +%c
> results in an error.

:r! date +%c
/tmp/mutt-linuxmafia-1000-23914-1114c

:r! date +'\%c'
Mon 16 Nov 2020 03:18:13 PM PST

Wow, pain in the tochis, huh?  Some days, I really hate having to always
worry about weird little shell quoting and escaping problems.

Could be worse:  You could have thought "I know!  I'll just use perl."
Then you have _two_ problems.  ;->

-- 
Cheers,                                       "The plural of regex is regrets."
Rick Moen                                      -- old coder gag, seen on Reddit
rick at linuxmafia.com
McQ! (4x80)



More information about the sf-lug mailing list