Another variation:

------------------------------------------------------
" Map <F10> to save after adding date info
map <F10> 1GO% Last saved:<ESC>:r !date<CR>kJ:w<CR>
------------------------------------------------------

1G
goes to the first line in the file

O (that's an uppercase letter O)
opens a new line above the current one and enters
insert mode

% Last saved:
inserts these characters literally

<ESC>
enters command mode

:r !date<CR>kJ
as before, inserts the output of "date" on a new line
below the current one, then joins the new line with
the current line

:w<CR>
writes the current buffer

Reply via email to