Vim-plug: Unable to install colorscheme properly

Created on 8 Nov 2019  路  7Comments  路  Source: junegunn/vim-plug

Explain the problem here ...
This is a great tool I can install most of the plugins faster and convenient way. However, it doesn't seem working or supporting to VIM install color schema.

To install onedark schema; I followed the following steps.

I add this description "Plug 'joshdick/onedark.vim', and source it then install it. I also add the colorshema name in .vimrc file. Once it's installed, I see that color schema is activated and seems working. Once I exit VIM, and open another file, I see that VIM can't find the color schema.

E185: Cannot find color scheme 'onedark'

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jun 06 2019 17:31:41)

  • Type:

    • [ x] Bug

    • [ x] Enhancement

    • [ x] Feature Request

    • [ x] Question

  • OS:

    • [ x] Linux (Ubuntu 18.04)

  • Vim:

    • [ x] Terminal Vim

question

Most helpful comment

silent! colorscheme onedark.

All 7 comments

Provide a minimal vimrc like the following:

call plug#begin('~/.vim/plugged')
Plug 'joshdick/onedark.vim'
call plug#end()
colorscheme onedark

If you have a vimrc like the following, then onedark should always load if the other Vim you opened uses the same vimrc.

Probably related: https://github.com/junegunn/vim-plug/wiki/faq#im-getting-cannot-find-color-scheme--does-vim-plug-support-color-schemes

Provide a minimal vimrc like the following:

call plug#begin('~/.vim/plugged')
Plug 'joshdick/onedark.vim'
call plug#end()
colorscheme onedark

If you have a vimrc like the following, then onedark should always load if the other Vim you opened uses the same vimrc.

right, it needs to be loaded every time using the following command.

call plug#begin('~/.vim/plugged')
Plug 'joshdick/onedark.vim'
call plug#end()
colorscheme onedark

On a fresh install in a docker container (Ubuntu 20.04), using

call plug#begin('~/.vim/plugged')
Plug 'joshdick/onedark.vim'
call plug#end()
colorscheme onedark

I still get the error:

E185: Cannot find color scheme 'onedark'

This is really annoying as it suddenly requires user input to type ENTER when using ansible.

silent! colorscheme onedark.

Thanks, yeah, that solved it.
However, it's still just supressing the error, not solving the issue. Or is this expected behavior?

Yes, it is expected on a fresh install. PlugInstall must run first before colorscheme onedark to avoid the error on a new machine.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SolaWing picture SolaWing  路  38Comments

Fashaun picture Fashaun  路  9Comments

nickvanderstel picture nickvanderstel  路  15Comments

go2null picture go2null  路  9Comments

zoqaeski picture zoqaeski  路  10Comments