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

the Colors are not being sourced automatically when i use colorscheme onehalfdark #104

Closed
smc181002 opened this issue Jan 7, 2021 · 2 comments

Comments

@smc181002
Copy link

hello guys, I am new to Vim and Neovim so forgive me if I didn't something wrong.
So the issue is, I am using neovim and I also use Plug for package management when I installed it with Plug 'sonph/onehalf', {'rtp': 'vim' } as mentioned in the docs.
but when I add cursorline onehalfdark to the init.vim file and then I run the command source % to apply the changes and it did work.
Then after when I closed the file and opened it again, it gave the error
image

Error detected while processing /root/.config/nvim/init.vim:
line   29:
E185: Cannot find color scheme 'onehalfdark'
Press ENTER or type command to continue

Now I found a solution but it is not an ideal as I think. what I did was to source the onehalfdark.vim file inside the init.vim file.
image

Now this did work but it isn't ideal 🤔
so please look into it because I loved the theme and this is a minus 😞
But if there is an error I made, please point it out 🙏

@kavinsood
Copy link

Remove all lines in which you manually tried to install it. Just use Vim-Plug. You have written the Vim-Plug syntax correctly. Make sure you write syntax on and colorscheme onehalfdark under the block for plugins. Then close init.vim using :wq, open it again, do these in order

:source %
:PlugInstall
:UpdateRemotePlugins
:q
:q!

When you open vim the next time, your theme should be present.

@sonph
Copy link
Owner

sonph commented Jan 15, 2021

Sorry for the late reply, I think you might have solved it by now :)

But as @k2s09 said you need to put the colorscheme onehalfdark command below the block for plugins. Statements are executed in order so you need to define the plugins for them to be sourced properly before calling colorscheme. Basically I'd put line 29 below 37 (end of plugins block).

Cheers!

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

3 participants