19646Conditionally sourcing a file based on sub-filetype
- Aug 1 1:27 PMI've started using closetag.vim, and I like it a lot. I'm looking for an easy
way to automatically source it when editing a compatible file. This would
include html, xml, asp, jsp, php, etc.
My problem is this:
If I edit a jsp file, the jsp syntax file automatically sources the html
syntax. main_syntax is defined as jsp, but no variable is stored stating that
this file is also html (kind of like a sub-filetype). I could modify html.vim
to automatically source closetag.vim, but it doesn't seem like a good practice
because when I upgrade to the next version, html.vim would be gone unless I
specifically remember to copy it over (and possibly merge any conflicts). I
believe this is what the $VIM/vimfiles/ directory was made for. To give you a
common place to put *your* files that are version independent. I could add
code to my vimrc file to source closetag.vim, but then I'd have to keep a long
list of all the different syntaxes that it works with, instead of relying on
the inclusion code already contained in the html.vim sourcing code path.
Am I missing an easy way to do this?
-- Daniel Einspanjer, daniel@... on 08/01/2001
- Next post in topic >>