[sf-lug] entering dates in vim text editor
aaronco36
aaronco36 at SDF.ORG
Fri Nov 20 09:13:59 PST 2020
Quoting alexkleider <alexkleider at protonmail.com> from [1]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
..... 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...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Indeed, Rick M's response seems to conform to "What The Customer really
needed" as per the renown Tree Swing Cartoon of [2]; the so-to-speak
"Customer" here being Alex K.
Also, K.I.S.S. [3] as opposed to other longer and more tortuous responses
elsewhere :-\
Additionally, there are the more concise "Using external tools" section of
the Vim Tips Wiki's webpage 'Insert current date or time' link [4] that
Steve already posted within [5] as well as the "Command Line Examples:
Reading and merging/including external text" section of YoLinux.com's
webpage 'Linux vi and vim editor: Tutorial and advanced features' [6].
-A
=====================================================
REFERENCES
=====================================================
[1]http://linuxmafia.com/pipermail/sf-lug/2020q4/015084.html
[2]https://www.smart-jokes.org/project-tree-swing.png
[3]media.frankwatching.com/app/uploads/2016/09/keep-it-simple-cartoon.jpg
[4]https://vim.fandom.com/wiki/Insert_current_date_or_time
[5]http://linuxmafia.com/pipermail/sf-lug/2020q4/015077.html
[6]www.yolinux.com/TUTORIALS/LinuxTutorialAdvanced_vi.html
=====================================================
aaronco36 at sdf.org
More information about the sf-lug
mailing list