0

In my installation of vim 8.1 (compiled from source) syntax highlighting is not working. The runtime path ($VIMRUNTIME) is set to

 /XYZ/VIM8/installnew/share/vim/vim81

which contains (autoload, colors, ftpligin, doc, keymap, spells, tutor etc..)

Futhermore, vimrc also contains

filetype plugin on
syntax on

in addition, the default folder .vim also contains a large selection of colors. Furthermore,

echo &rtp prints:     
/XYZ/.vim,/XYZ/.vim/pack/bundle/start/l9,/XYZ/.vim/pack/bundle/start/ack,/XYZ/.vim/pack/bundle/start/FuzzyFinder

Yet, I am getting the error:

E185: Cannot find color scheme 'darkblue'
Press ENTER or type command to continue 

The colors are not highlighted. In addition colorscheme <tab> yields no result.

I tried various colors in the above mentioned folders but none worked. What is the cause of this problem?

2
  • 1
    Does /XYZ/VIM8/installnew/share/vim/vim81/colors/darkblue.vim exist? What does :echo &rtp print? Please update question.
    – Ralf
    Jan 24, 2019 at 20:21
  • it exists. Updating question
    – wander95
    Jan 24, 2019 at 20:25

1 Answer 1

1

Your runtimepath seems incomplete. I would expect that it contains the following directories:

  • /XYZ/VIM8/installnew/share/vim/vimfiles
  • /XYZ/VIM8/installnew/share/vim/vim81
  • /XYZ/VIM8/installnew/share/vim/vimfiles/after

These directories are part of the default value of runtimepath. Note that the first (vimfiles) and the last (vimfiles/after) might not exists when installing from source.

Check your vimrc for manipulation of the runtimepath (something like set runtimepath or set rtp).

If you manipulate the runtime path you should always use set runtimepath+= (to append) or set runtimepath^= (to prepend). See :help :set+= and :help :set^=.

2
  • I did not find folders "vimfiles" and "after". The share folder only contains "man" and "vim"
    – wander95
    Jan 24, 2019 at 20:44
  • @wander95 True, they don't exist on my machine either (self-installed Vim). Added note to answer.
    – Ralf
    Jan 24, 2019 at 20:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.