E185: Cannot find color scheme*

落花浮王杯 提交于 2020-05-12 11:31:09

问题


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.


回答1:


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




回答2:


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

Try to rename blue.vim to blue.




回答3:


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.



来源:https://stackoverflow.com/questions/40077211/e185-cannot-find-color-scheme

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!