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

26452Re: journal in vim?

Expand Messages
  • Rimon Barr
    Feb 27, 2002
      >I'm looking for ideas on how to implement a journal in vim -- a file that
      >would create a new date/time stamp automatically each time it was opened,
      >and move the cursor under the newly created entry. or something similar.
      >has anyone built something like this, or just have some suggestions about
      >the best way to implement it.

      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:

      Stick the following two lines in your .vimrc:
      " date stamp
      map ,date O<Esc>:.!date -I<CR>$a:<CR><Esc>60i-<Esc>O<Esc>

      Then, just type ",date". You can change the format to what pleases you,
      but you get the idea. You can also map it to a more convenient key, if you
      use it often. (Oh, it depends on the date command being available on your
      system, so it won't work on Windows.)

      All the best,
      * Rimon Barr Ph.D. student, Computer Science, Cornell University
      | barr@... - http://www.cs.cornell.edu/barr - Y!IM: batripler
      | It is easier to go down a hill than up, but the view is from the top.
      +---- -- Arnold Bennett
    • Show all 8 messages in this topic