colorscheme get's sourced twice resulting in lost custom highlighting
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
vim (Ubuntu) |
Fix Released
|
Medium
|
Ian Jackson |
Bug Description
I had trouble with highlighting declerations in my .vimrc being lost when I
specified a colorscheme. Preben 'Peppe' Guldberg found the source of the
problem, here's what he had to say:
OK. I had a quick look at vim.out and see the following:
1) your vimrc is sourced and everything should be set up as you want it
2) $VIM/gvimrc is sourced
3) "syntax on" - eventually sourcing $VIMRUNTIME/
4) your colour scheme is sourced again
In the last step, "i clear" is issued, clearing your highlighting.
Actually, your highlighting is only cleared because you also use a
colour scheme.
In my book, the $VIM/gvimrc could be improved. It contains a test that
reads
if has("syntax") && (&t_Co > 2 || has("gui_running"))
I would change that to
if has("syntax") && (&t_Co > 2 || has("gui_running")) && !syntax_on
which does not turn syntax on again, if it has already been done (by
you, eg. in your vimrc).
I also find the test for gui_running in a gvimrc redundant, but perhaps
the file is used as both a vimrc and a gvimrc.
Almost 4 months and still no response?