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

Re: journal in vim? -> date+time abbreviations

Expand Messages
  • Sven Guckes
    ... right - it wont work on Windows then. therefore you better use the internal function strftime for that: iab Ydate =strftime( %y%m%d ) iab Ytime
    Message 1 of 8 , Mar 1 11:00 AM
    • 0 Attachment
      * Rimon Barr <barr@...> [020227 19:22]:
      > I don't date the file *each* time that I open it, because I
      > open it more often than I would like to date it, but I have
      > a quick-and-dirty macro to perform the timestamp for me:
      > map ,date O<Esc>:.!date -I<CR>$a:<CR><Esc>60i-<Esc>O<Esc>
      > (Oh, it depends on the date command being available
      > on your system, so it won't work on Windows.)

      right - it wont work on Windows then. therefore you
      better use the internal function strftime for that:

      iab Ydate <C-R>=strftime("%y%m%d")<CR>
      iab Ytime <C-R>=strftime("%H:%M")<CR>
      iab YDT <C-R>=strftime("%y%m%d %X")<CR>
      iab YDATE <C-R>=strftime("%a %b %d %T %Z %Y")<CR>

      see my vimrc.forall for comments and examples.

      Sven

      --
      Sven Guckes guckes@... Sven's commented setup files for Vim:
      http://www.vim.org/gvimrc personal setup file for GUI Vim
      http://www.vim.org/vimrc personal setup file for non-GUI Vim
      http://www.vim.org/vimrc.forall setup file for everyone
      http://www.vim.org/vimrc.forall.gz compressed setup file for everyone
      Lots of commented options and mappings for everyday editing.
    Your message has been successfully submitted and would be delivered to recipients shortly.