jonhoo / configs

My configuration files

Home Page:http://thesquareplanet.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Perplexing init.vim error: Cannot find color scheme 'base16-gruvbox-dark-hard'

nikitamounier opened this issue · comments

Hi Jon!

I'm getting an error in my init.vim file:
Error detected while processing /Users/nikitamounier/.config/nvim/init.vim: line 72: E185: Cannot find color scheme 'base16-gruvbox-dark-hard'

However, I've installed the base16-gruvbox-dark-hard.vim file, and its corresponding base16-gruvbox-dark-hard.sh shell file, and have correctly declared the shell path inside init.vim as required.

As a consequence of this error, some other related errors follow:

line   78:
E121: Undefined variable: g:base16_gui09
E116: Invalid arguments for function Base16hi
line   80:
E121: Undefined variable: g:base16_gui05
E116: Invalid arguments for function Base16hi
And another error which I don't think is related, but here it is just in case:
These are elated to the "cmp" plugin. I have lua installed using homebrew in the opt directory (since I'm on M1).
 line  184: E5108: Error executing lua [string ":lua"]:1: module 'cmp' not found:
        no field package.preload['cmp']
        no file './cmp.lua'
        no file '/opt/homebrew/Cellar/luajit-openresty/2.1-20220111/share/luajit-2.1.0-beta3/cmp.lua'
        no file '/usr/local/share/lua/5.1/cmp.lua'
        no file '/usr/local/share/lua/5.1/cmp/init.lua'
        no file '/opt/homebrew/Cellar/luajit-openresty/2.1-20220111/share/lua/5.1/cmp.lua'
        no file '/opt/homebrew/Cellar/luajit-openresty/2.1-20220111/share/lua/5.1/cmp/init.lua'
        no file './cmp.so'
        no file '/usr/local/lib/lua/5.1/cmp.so'
        no file '/opt/homebrew/Cellar/luajit-openresty/2.1-20220111/lib/lua/5.1/cmp.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
        [C]: in function 'require'

Any idea where I've gone wrong? My nvim config folder is essentially a copy of yours. I've been trying to fix this for some days now, but to no avail. I would really appreciate any guidance!

Hmm, have you made sure that the .vim file is in a place Vim knows to look?

set rtp+=~/dev/others/base16/templates/vim/

Thanks for the reply! Yes – I put the .vim file in the same place as the .sh file, which are both in ~/.config/nvim/scripts (and the set rtp command in my init.vim file reflects that).

Should they not be in the nvim .config directory, should I place them somewhere else?

Hmm, then I'm not sure I'm afraid. I'm not super familiar with the intricacies of Vim's configuration search algorithm. I'd try turning on debug logs and start digging in 😅

Yup, I tried moving the files elsewhere, but no difference. Time to have some debug fun!

Thanks anyways, and thanks for the quick replies! Would you like me to leave this open in case I find a solution?

Please do post back if you figure it out in case it might helps others! But I'll go ahead and close the issue here since I don't think matters much whether it's open :)

I solved the problem about the'base16-gruvbox-dark-hard' by

mkdir colors
cd colors

(creating a directory called colors at ~/.config/nvim/)

then put the base16-gruvbox-dark-hard.vim file into that directory
and the result should be
~/.config/nvim/colors/base16-gruvbox-dark-hard.vim

Another error as described:

line 184: E5108: Error executing lua [string ":lua"]:1: module 'cmp' not found:
no field package.preload['cmp']
no file './cmp.lua'
no file '/opt/homebrew/Cellar/luajit-openresty/2.1-20220111/share/luajit-2.1.0-beta3/cmp.lua'
no file '/usr/local/share/lua/5.1/cmp.lua'
no file '/usr/local/share/lua/5.1/cmp/init.lua'
no file '/opt/homebrew/Cellar/luajit-openresty/2.1-20220111/share/lua/5.1/cmp.lua'
no file '/opt/homebrew/Cellar/luajit-openresty/2.1-20220111/share/lua/5.1/cmp/init.lua'
no file './cmp.so'
no file '/usr/local/lib/lua/5.1/cmp.so'
no file '/opt/homebrew/Cellar/luajit-openresty/2.1-20220111/lib/lua/5.1/cmp.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'require'

could be solved by

nvim 
:PlugInstall

(This install the plugins in the init.vim and the error never occurred again.)