Getting vim to do this is actually pretty straightforward, but figuring out how was a pain. The info is scattered across a bunch of help files and cluttered with references to old versions and non-recommended options. So I'm pulling it together here.
First, create a
~/.vim/syntax/blog.vim
file containing:runtime! syntax/xhtml.vim
This says to invoke the xhtml syntax file. (You could do plain html instead.)
Then you need to tell vim to use the blog.vim syntax when you're editing a .blog file. To do this, create a
~/.vim/ftdetect/blog.vim
file containing:au BufRead,BufNewFile *.blog set filetype=blog
That's it.
No comments:
Post a Comment