ap / vim-css-color

Preview colours in source code while editing
http://www.vim.org/scripts/script.php?script_id=5056
MIT License
1.77k stars 78 forks source link

css_color#init is not being detected #154

Open Maxsash opened 3 years ago

Maxsash commented 3 years ago

I get the following error:

Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/c.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/cfg.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/clojure.vim: line 2: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/csh.vim: line 2: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/css.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/dosini.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/elm.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/fish.vim: line 3: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/go.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/html.vim: line 2: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/i3.vim: line 3: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/i3config.vim: line 2: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/javascript.vim: line 10: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/json.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/jsx.vim: line 3: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/less.vim: line 8: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/moon.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/nix.vim: line 2: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/perl.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/php.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/python.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/qml.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/r.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/ruby.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/sass.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/scss.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/sh.vim: line 2: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/stylus.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/tcsh.vim: line 2: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/tmux.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/typescript.vim: line 3: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/vala.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/vim.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/xdefaults.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/xml.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/yaml.vim: line 1: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/after/syntax/zsh.vim: line 2: E117: Unknown function: css_color#init Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/syntax/colornames/basic.vim: line 25: E121: Undefined variable: b:css_color_hi E116: Invalid arguments for function extend Error detected while processing /home/maxsash/.vim/plugin/color/vim-css-color/syntax/colornames/extended.vim: line 8: E484: Can't open file syntax/colornames/basic.vim line 134: E121: Undefined variable: b:css_color_hi E116: Invalid arguments for function extend Press ENTER or type command to continue

cloned the repo into ~.vim/plugin/color/ made no other changes I have no plugin manager

ap commented 3 years ago

cloned the repo into ~.vim/plugin/color/

That’s why it doesn’t work. That’s not how installing plugins works in Vim.

made no other changes

Sure, the one change you made is all it takes to break it. If you put it in ~/.vim/pack/css-color/start/css-color it will work.

If you don’t want to do that, you don’t have to – the way Vim loads plugins gives you a wide variety of ways of how to add the files from this plugin to your setup so that it will work. E.g. the parts in that path called css-color can be called anything else, and that will work just as well. Feel free to read the Vim docs on how all that works and do it some other way.

Maxsash commented 3 years ago

cloned the repo into ~.vim/plugin/color/

That’s why it doesn’t work. That’s not how installing plugins works in Vim.

made no other changes

Sure, the one change you made is all it takes to break it. If you put it in ~/.vim/pack/css-color/start/css-color it will work.

If you don’t want to do that, you don’t have to – the way Vim loads plugins gives you a wide variety of ways of how to add the files from this plugin to your setup so that it will work. E.g. the parts in that path called css-color can be called anything else, and that will work just as well. Feel free to read the Vim docs on how all that works and do it some other way.

I did try putting it in that directory as well. Doing that made it not detect anything at all. I mean vim opened up like nothing was changed. About ~.vim/plugin : I followed the steps from :help plugin. Whatever be the case. I guess I will try again. Thank you for your comment.

ap commented 3 years ago

I did try putting it in that directory as well. Doing that made it not detect anything at all.

Hmm, curious.

What version of Vim are you using? (:version)

What else is in your Vim config?

I followed the steps from :help plugin

Yeah, I can see that now. Those instructions are… unfortunate. (They’ll work for (almost all) plugins that come in a single file, but they’re almost certain to be wrong for more complex plugins.)

Maxsash commented 3 years ago

My vim version is 8.2. You can check out my config file here. It is pretty simple. I did start using another plugin for highlighting colors since this was not working for me.

Those instructions are… unfortunate.

That did occur to me so I simply removed the contents of ~/.vim/plugin and copied the command from README here but that looked like a further step back.

Let me know if you can figure something out because I really would rather use this one as this seems more active.