At work I usually keep only a few files in buffer, typically a Yang file, a Java file, and possibly something like a readme file. In such an environment, the Yang syntax highlighting does not work. Example "run":
$ vim yangfile.yang # Yang syntax highlighting works
:e Foo.java # new or existing file, doesnt'matter
:bnext # Yang syntax highlighting is gone, all text is white
:so ~/.vimrc # this does not work
My .vimrc
is quite small, it starts with source ~/yang.vim
(this file is available here) and then less than 50 more lines of pretty basic Vim configurations (I can edit my question to include the entire .vimrc
on request).
How can I fix this problem? Thanks.
runtimepath
. Then havingsyntax on
in your vimrc will automatically load syntax highlighting (you may also needfiletype plugin on
; i cant remember).:set runtimepath?
spit out several paths,~/.vim
was one of them. I moved my syntax file there, addedsyntax on
to.vimrc
, highlighting did not work, addedfiletype plugin on
, didn't work either. More suggestions? :)