vim plugin - Vim is loading the system syntax after my custom syntax so my custom syntax is not being applied -
i have custom javascript syntax file in ~/.vim/syntax folder on ubuntu 12.04, when open .js file in vim uses system syntax instead:
output of :scriptnames
1: /usr/share/vim/vimrc 2: /usr/share/vim/vim73/debian.vim 3: /usr/share/vim/vim73/syntax/syntax.vim 4: /usr/share/vim/vim73/syntax/synload.vim 5: /usr/share/vim/vim73/syntax/syncolor.vim 6: ~/.vim/filetype.vim 7: /usr/share/vim/vim73/filetype.vim 8: /usr/share/vim/vim73/plugin/getscriptplugin.vim 9: /usr/share/vim/vim73/plugin/gzip.vim 10: /usr/share/vim/vim73/plugin/matchparen.vim 11: /usr/share/vim/vim73/plugin/netrwplugin.vim 12: /usr/share/vim/vim73/plugin/rrhelper.vim 13: /usr/share/vim/vim73/plugin/spellfile.vim 14: /usr/share/vim/vim73/plugin/tarplugin.vim 15: /usr/share/vim/vim73/plugin/tohtml.vim 16: /usr/share/vim/vim73/plugin/vimballplugin.vim 17: /usr/share/vim/vim73/plugin/zipplugin.vim 18: ~/.vim/syntax/javascript.vim 19: /usr/share/vim/vim73/syntax/javascript.vim how custom syntax apply *.js files?
you have syntax file placed in proper place ~/.vim/syntax/javascript.vim. reason system syntax file shows sourced. first couple of lines in file check see if other syntax file sourced. since current syntax set, system syntax file exits without doing anything.
so custom 1 sourced first (and has highlighting applied). system 1 sourced. why see both in output of :scriptnames
so vim apply custom syntax rules need nothing because files in right place.
Comments
Post a Comment