On 20 May 2010, at 15:02, David Reed wrote:
> Ultimately, I would like to be able to open a new .tex,.html,.c file and have 
> it load a skeleton that automatically has the date created in the comment 
> header as well as any other information.  
> 
> To this end my first attempt is just to have a file automatically add "I 
> added this" at the top.  This is the code I put in my vimrc file and nothing 
> is happening.  
> 
> :autocmd FileWritePre normal iI added this<Esc>
> 
> Not sure what I am doing wrong.  Thanks for any help.

Try the BufNewFile event:

    autocmd BufNewFile normal iIadded this

See :help autocmd-events for more information about which events fire when.

I also think you don't need <Esc>, but I'm not 100% sure about this.

Regards,
Andy Stewart

-------
http://airbladesoftware.com


-- 
You received this message from the "vim_mac" 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

Reply via email to