Thursday, March 3, 2011

Re: Command to insert dated comment

On Thu, 3 Mar 2011, Sapfeer wrote:

> Dear all,
>
> I want to create a command that will insert comment mark, for instance '#',
> space, date and time on the next line after current, but AFAICS there is no
> way to put insert commands like *o* in command. The most obvious way - use
> mapping, but it is preferable to use command feature

From my .vimrc:

function Date()
execute ":normal i".strftime("%d-%b-%Y", localtime())." \<ESC>3bgUwf "
endfunction

which I invoke as :call Date()

# suppose I am here: ->03-MAR-2011
>
> Thanks in advance
>
Hugh

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: