Bigbadboybob
Bigbadboybob

Reputation: 1098

E185: Cannot find color scheme*

I have been customizing my vimrc file but for some reason, no colorschemes work. Whenever I try to change the colorscheme, it just gives me:

E185: Cannot find color scheme '*'

I checked the color folder to make sure I actually have colors and I do. For example the first item in the color folder is blue.vim but when I put colorscheme blue in the vimrc, it just gives

E185: Cannot find color scheme 'blue'

when I start Vim and the colorscheme doesn't apply. I also tried changing the colorscheme from within Vim and it also returns the same error. All the other vimrc settings that I've tried work so far.

Upvotes: 37

Views: 81734

Answers (6)

Cloud Cho
Cloud Cho

Reputation: 1774

My solution was:
  (1) Download color scheme from 150 colors for example
   Reference: Vim Color Scheme

  (2) Move the files in "colors" folder from (1) to "/usr/share/vim/vimfiles/colors/"
   Folder looks like depending on OS. CentOS has in this folder not like "~/.vim/colors/" in Ubuntu OS.
   Reference: Ingo Karket's suggestion above, Caleb's post, Enrico's note

  (3) Add line of colorscheme <color scheme> at "~/.vimrc"
   Please, match upper and lower case of the color scheme in "colors" folder

Runtime environment:
  OS: CentOS 7.9
  Computer: Intel Nuc

Upvotes: 0

1of7
1of7

Reputation: 31

This may also be due to entries/artifacts in your configuration files (~/.vimrc,system vimrc), or if you use the "vim -u ..." command line option to point to a custom configuration file. The artifacts could be something like: set rtp -=$HOME/.vimrc set rtp -=$HOME/.vimrc/after set runtimepath -= $HOME/.vimrc ...etc... If you find these entries in your configuration files, then comment them out to see if the error goes away. These are often entries in test configurations of vim to be used only in special instances. If you used such a test configuration file as the template for your routine vim configuration, then they are likely uneccessary.

Upvotes: 1

Lual
Lual

Reputation: 3168

For those using Plug as plugin manager, the problem may be solved by setting the color scheme after declaring the plugin that provides the theme:

call plug#begin()
Plug 'rakr/vim-one'   " tell Vim to load the theme/plugin
call plug#end()

colorscheme one       " set the color scheme after the theme provider has been loaded

Upvotes: 57

Mosquite
Mosquite

Reputation: 585

I recently had this error. The problem in my case was that the name of the colorscheme in the file was different from the file name. Renaming the colorscheme in the file fixed it for me.

In COLOR1.vim:

let g:colors_name = "COLOR2"

Changing to:

let g:colors_name = "COLOR1"

fixed the problem.

I assume that changing the file name would also fix this.

Upvotes: 3

Michele Eustacchi
Michele Eustacchi

Reputation: 31

For me it worked by removing the extension from the colorscheme file.

Try to rename blue.vim to blue.

Upvotes: 3

Ingo Karkat
Ingo Karkat

Reputation: 172748

This sounds like a problem with your 'runtimepath' option. If you use a plugin manager, these usually extend that. The default location should be ~/.vim/colors. Please check with

:set runtimepath?

There should be a ~/.vim in there (or equivalent).

If all else fails, you could also just :source /full/path/to/your/color.vim

Upvotes: 38

Related Questions