OESF Portables Forum

Everything Else => General Support and Discussion => Zaurus General Forums => Archived Forums => Software => Topic started by: jamesannan on March 01, 2008, 01:13:14 am

Title: Date Stamp In Vim
Post by: jamesannan on March 01, 2008, 01:13:14 am
I would like to have a way of inserting the date in vim, in my own preferred format. I can use
:r !date
and get the standard date format, but when I try
:r !date +"%Y %m %d" or whatever, the % get replaced by the current filename.

Ok, this may seem like more of a vim question than a zaurus question, but all the stuff I find on the web refers to strftime which my vim (from here: http://sharpromfeed.home.linuxtogo.org/feed/) (http://sharpromfeed.home.linuxtogo.org/feed/)) does not seem to have. I also see lots on the web about "escaping" various characters to stop vim substituting them (and I've tried a lot of random things) but nothing that appears to covers this situation. I'd be grateful fo a hint.

James
Title: Date Stamp In Vim
Post by: alexl on July 12, 2009, 03:21:20 am
Escape the '%' characters with '\' and it should work, e.g.
[div class=\'codetop\']CODE[/div][div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']:r !date +"\%Y \%m \%d"[/div]