osx - How can i prevent my vim plugins being overridden by older ones? -
i have installed macvim via homebrew, , pathogen via downloading pathogen.vim file ~/.vim/autoload directory. have got cloned vim-perl plugin ~/.vim/bundle directory.
however, when open perl file, uses syntax highlighting perl.vim file included macvimand not downloaded plugin. output of :scriptnames. note macvim supplied plugins there , think perl ones listed lastly overwrite downloaded plugin:
1: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/vimrc 2: ~/.vimrc 3: ~/.vim/autoload/pathogen.vim 4: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/ftoff.vim 5: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/syntax/syntax.vim 6: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/syntax/synload.vim 7: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/syntax/syncolor.vim 8: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/filetype.vim 9: ~/.vim/bundle/vim-javascript/ftdetect/javascript.vim 10: ~/.vim/bundle/vim-perl/ftdetect/mason-in-html.vim 11: ~/.vim/bundle/vim-perl/ftdetect/perl11.vim 12: ~/.vim/bundle/vim-ruby/ftdetect/ruby.vim 13: ~/.vim/bundle/vim-scala/ftdetect/scala.vim 14: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/menu.vim 15: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/autoload/paste.vim 16: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/ftplugin.vim 17: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/indent.vim 18: ~/.vim/colors/default.vim 19: ~/.vim/bundle/vim-scala/plugin/scala.vim 20: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/plugin/getscriptplugin.vim 21: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/plugin/gzip.vim 22: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/plugin/matchparen.vim 23: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/plugin/netrwplugin.vim 24: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/plugin/rrhelper.vim 25: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/plugin/spellfile.vim 26: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/plugin/tarplugin.vim 27: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/plugin/tohtml.vim 28: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/plugin/vimballplugin.vim 29: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/plugin/zipplugin.vim 30: ~/.vim/bundle/vim-scala/after/plugin/help.vim 31: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/gvimrc 32: ~/.vim/bundle/vim-perl/syntax/perl.vim 33: ~/.vim/bundle/vim-perl/syntax/pod.vim 34: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/syntax/pod.vim 35: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/syntax/perl.vim 36: ~/.vim/bundle/vim-perl/ftplugin/perl.vim 37: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/ftplugin/perl.vim 38: ~/.vim/bundle/vim-perl/indent/perl.vim 39: /usr/local/cellar/macvim/7.4-73/macvim.app/contents/resources/vim/runtime/indent/perl.vim here ~/.vimrc file
set shell=/bin/sh phone call pathogen#infect() filetype off syntax on filetype plugin indent on if :so ~/.vim/bundle/vim-perl/syntax/perl.vim file syntax highlights correctly.
how can prevent macvim bundled ones overriding?
the inclusion guard (if exists("b:current_syntax")) should prevent default perl syntax script having effect (after custom 1 has been sourced).
as workaround, move own script ~/.vim/bundle/vim-perl/syntax/perl.vim ~/.vim/bundle/vim-perl/after/syntax/perl.vim, or alternatively create ~/.vim/after/syntax/perl.vim script with
so ~/.vim/bundle/vim-perl/syntax/perl.vim in it.
osx vim homebrew macvim pathogen
No comments:
Post a Comment