1

I have a couple of things which suggest there's an issue with the way I use colorscheme with my vimrc file.

  • Errors when running source ~/.vimrc
  • The colorscheme used when opening a vim session

Sourcing vimrc

If I update my vimrc file and source it to see the changes in my current session I get the following error:

Error detected while processing /usr/share/vim/vim80/syntax/synload.vim:
line   19:
E185: Cannot find color scheme 'vim-monokai-tasty'

Despite the complaint the colour scheme does seem to update to be monokai-tasty. The colour scheme is at ~/.vim/colors/monokai-tasty.vim.


Vim Sessions

If I start a vim session with vim -S /path/to/session.vim some colour scheme, other than monokai-tasty is used. This would be a time where I may use :source ~/.vimrc and get the above errors, but also the correct colour scheme.

Saving the vim session after making changes to the colour scheme seems to have no effect upon starting a new session.


Any help would be greatly appreciated. Here is where you can find my vim and vim/colors directories

1 Answer 1

1

The colorscheme in question, "monokai-tasty.vim" does not properly set g:colors_name:

let g:colors_name = "vim-monokai-tasty"

g:colors_name should be set to the file name of the colorscheme without the .vim. Correct:

let g:colors_name = "monokai-tasty"

When the two differ, setting colorscheme initially appears to work. However there are instances where vim reloads the colorscheme, and it uses g:colors_name to do that. At that point the error will be generated.

2
  • 1
    Works great! Thank you so much.
    – BitFlow
    Jul 2, 2019 at 16:31
  • It would be worth it to create a issue in there Github issue tracker if they have one.
    – statox
    Jul 3, 2019 at 7:13

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.