Tip #375: autocmd for skeleton html file (BufFileNew)
tip karma |
Rating 19/7, Viewed by 955
|
created: |
|
November 25, 2002 12:23 |
|
complexity: |
|
basic |
author: |
|
Dan Allen |
|
as of Vim: |
|
5.7 |
How about starting your new html document with a nice shiny skeleton!
Add this in your autocmd section in your .vimrc file
" Start with an html skeleton docuement when opening a new *.html file
au BufNewFile *.html | execute "normal :set ai!\<kEnter>i<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transiti onal//EN\">\<kEnter><html>\<kEnter> <head>\<kEnter> <style>\<kEnter> </style>\<kEnter> <script>\<kEnte r> </script>\<kEnter> </head>\<kEnter> <body>\<kEnter> </body>\<kEnter></html>\<ESC>:set ai\<kEnter>gg"
<<VIM's Filtering Commands Summary |
A totally useless tip...or is it ? >>
Additional Notes
|