Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flag to Indicate Gruvbox Loaded #256

Open
neur1n opened this issue Dec 19, 2018 · 1 comment
Open

Flag to Indicate Gruvbox Loaded #256

neur1n opened this issue Dec 19, 2018 · 1 comment

Comments

@neur1n
Copy link

neur1n commented Dec 19, 2018

Hello, I have the problem that if I deploy my vimrc in a new environment, an error occurs if gruvbox is not installed since I use vim-plug to install it afterwards. So can it provide a flag that indicating if gruvbox is loaded, so that I can make it fall back to a builtin colorscheme.

Or, is there a workaround? Thanks.

@ghost
Copy link

ghost commented Feb 27, 2019

Gruvbox itself can't provide that flag, because (as you mentioned) gruvbox isn't loaded/installed so there is no way it could set any flags.

In the other hand, there are some workarounds.
You could make the colorscheme gruvbox silent so there wouldn't be any errors if it couldn't be loaded like so silent! colorscheme gruvbox.

For a default color scheme, you need to add it BEFORE gruvbox.
For example, if you want desert to be your default color scheme add these lines to your vimrc:

silent! colorscheme desert
silent! colorscheme gruvbox

Forum post can be found here.

Also, notice that this approach may not work for airline/lightline if you are using them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant