26452Re: journal in vim?
- Feb 27, 2002
>I'm looking for ideas on how to implement a journal in vim -- a file thatI don't date the file *each* time that I open it, because I open it more
>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.
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
- << Previous post in topic Next post in topic >>