Monday, 22 February 2010
Matching html/xml/script tags with matchit.vim
It is incredibly useful to be able to match tags in tangled PHP,Javascript and HTML files this is possible with the plugin matchit.vim. You will already know that Vim matches or jumps to a matching parenthesis ({{ , with matchit.vim you can jump to a matching tag.
Recently I need to configure it so that it would match tags in html files with the arbitrary extension index.raa
I achieved this by adding *.raa to the following line
au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm,*.raa call s:FThtml()in filetype.vim
but that's not upgrade safe so instead create
a subdirectory ftdetect in your vim folder
and create a file (in my case)
raa.vim containing just one line
au! BufRead,BufNewFile *.raa set filetype=raa
Labels: matchit.vim
Subscribe to Posts [Atom]
Post a Comment