RE: inserting date
- On Tue, 3 Jun 2003 at 10:00am, Geoffrey Mann wrote:
>Just a couple of minor suggestions, if you are interested only in insert
> The following abbreviations can be added to your _vimrc or .vimrc file:
> "date/time abbreviations
> " Wed 01 Jan 2003
> ab mdyl <c-r>=strftime("%a %d %b %Y")<cr>
> " 030101
> ab mdys <c-r>=strftime("%y%m%d")<cr>
> " 01/01/2003 07:55:50
> ab mdyc <c-r>=strftime("%c")<cr>
> " 01/01/03 19:56:01
> ab hml <c-r>=strftime("%d/%m/%y %H:%M:%S")<cr>
> " 19:56:06
> ab hms <c-r>=strftime("%H:%M:%S")<cr>
> These will allow a variety of formats for the current time.
> These are posted somewhere on the vim.org site but I forget where.
mode, you can use :iabbr instead of :abbr to reduce unexpected results.
Also, use tokens that are hard to occur normally. I prefer surrounding
them with back-slashes, so the above would become:
iab \mdyl\ <c-r>=strftime("%a %d %b %Y")<cr>
and so on.
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).