[sf-lug] entering dates in vim text editor

alexkleider alexkleider at protonmail.com
Tue Nov 17 16:51:48 PST 2020


..... 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.
>

Thanks, Rick.  That does the trick...
although I don't understand why the % must be escaped when it appears within single quotes.
Cheers,
Alex



More information about the sf-lug mailing list