I\'m just logging some work as I do it, each line being an action, I will be trying to do this every few minutes. Is there a trick way of inserting date/time something like
This should help you: Insert current date or time
See here
Press F5 in normal mode or in insert mode to insert the current datestamp:
:nnoremap <F5> "=strftime("%c")<CR>P
:inoremap <F5> <C-R>=strftime("%c")<CR>
I prefer to set an abbreviation for this like:
iab xdate <c-r>=strftime("%d/%m/%y %H:%M:%S")<cr>
So when I type "Downloaded source code on xdate"
, vim automatically expands the "xdate"
to "14/06/11 hrs:mins:secs"
. Being in insert mode and not having to disrupt my flow of typing to either get into normal mode or press a shortcut is useful at times. Also, you can set it to a shorter combination than "xdate"
if you so wish.