Insert date and time into Vim or Textmate documents

Thu Sep 20 12:23:36 PDT 2007

Tracked down an easy method to insert the current date (timestamp) into a Vim document:

:r !date

Producing:

Thu Sep 20 12:24:50 PDT 2007

http://princ3.wordpress.com/2007/08/27/insert-current-date-in-vim/

Should probably set up a single key command for that, maybe an F key.

Thu Sep 20 15:36:40 PDT 2007

Within TextMate, short of creating an internal command, the easiest way is to use the Text > Execute Line and Replace with Result and then using the /bin/date utility by simply typing date and then the ctrl-option-r shortcut

Reply

The content of this field is kept private and will not be shown publicly.
  • You can use Markdown syntax to format and style the text.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <a> <cite> <code> <strong> <em> <blockquote> <b> <i> <p> <br> <ul> <ol> <li>

More information about formatting options