OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio


Welcome Guest ( Log In | Register )

> Date Stamp In Vim
post Feb 29 2008, 10:13 PM
Post #1

Group: Members
Posts: 119
Joined: 8-July 04
Member No.: 3,955

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

Go to the top of the page
+Quote Post
Start new topic
post Jul 11 2009, 11:21 PM
Post #2

Group: Members
Posts: 9
Joined: 18-July 04
Member No.: 4,030

Escape the '%' characters with '\' and it should work, e.g.
:r !date +"\%Y \%m \%d"
Go to the top of the page
+Quote Post

Posts in this topic
jamesannan   Date Stamp In Vim   Feb 29 2008, 10:13 PM
alexl   Escape the '%' characters with '...   Jul 11 2009, 11:21 PM

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 28th October 2016 - 12:10 PM