Loading ...
Sorry, an error occurred while loading the content.

RE: inserting date

Expand Messages
  • Hari Krishna Dara
    ... Just a couple of minor suggestions, if you are interested only in insert mode, you can use :iabbr instead of :abbr to reduce unexpected results. Also, use
    Message 1 of 6 , Jun 3, 2003
    • 0 Attachment
      On Tue, 3 Jun 2003 at 10:00am, Geoffrey Mann wrote:

      >
      > The following abbreviations can be added to your _vimrc or .vimrc file:
      >
      > "date/time abbreviations
      > " Wed 01 Jan 2003
      > ab mdyl <c-r>=strftime("%a %d %b %Y")<cr>
      > " 030101
      > ab mdys <c-r>=strftime("%y%m%d")<cr>
      > " 01/01/2003 07:55:50
      > ab mdyc <c-r>=strftime("%c")<cr>
      > " 01/01/03 19:56:01
      > ab hml <c-r>=strftime("%d/%m/%y %H:%M:%S")<cr>
      > " 19:56:06
      > ab hms <c-r>=strftime("%H:%M:%S")<cr>
      >
      > These will allow a variety of formats for the current time.
      > These are posted somewhere on the vim.org site but I forget where.
      >
      > Geoff

      Just a couple of minor suggestions, if you are interested only in insert
      mode, you can use :iabbr instead of :abbr to reduce unexpected results.
      Also, use tokens that are hard to occur normally. I prefer surrounding
      them with back-slashes, so the above would become:

      iab \mdyl\ <c-r>=strftime("%a %d %b %Y")<cr>

      and so on.

      HTH,
      Hari

      __________________________________
      Do you Yahoo!?
      Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
      http://calendar.yahoo.com
    Your message has been successfully submitted and would be delivered to recipients shortly.