vim-css-color
vim-css-color copied to clipboard
Add documentation for enable/disable/toggle
And I guess also for how to write support for new filetypes and the fact that you can have them in your .vim/after independently of the filetypes supported by the plugin.
I second this. I want move to this plugin, but there is no documentation for me to fallow, or instructions leading me to the name of the help file.
@BubbatheVTOG: The short answer is, look at :set filetype? in the file where you want to enable vim-css-color, and if for example it says foo, then make a file ~/.vim/after/syntax/foo.vim that looks like one of the files in the plugin’s after/syntax/.
Is there any way to disable it at the moment?
I couldn't see one, so today I added this to the top of css_color#init():
if get(g:, 'css_color_disabled', 0) || get(b:, 'css_color_disabled', 0)
return
endif
Although it might be more appropriate at the top of s:create_matches()
(Why did I need it? I was opening a handlebars (.hbs) file and Vim was calling css_color#init() multiple times, making it really slow to load the file. Disabling the plugin for those files was a quick and easy fix. It could be an issue with other plugins I am running. I get quite a lot of calls when loading .markdown files too. But when I open a .json file, I see only: hex, css, css, and for .vimrc and .yaml files, only hex. This is likely exacerbated by other plugins, something I could try to narrow down, but if I find out otherwise I will open a new issue.)
There is css_color#disable() to turn it off in the current buffer, but no way to prevent it from being loaded in a buffer.
Is there a way to toggle it with a single mapping?
EDIT:css_color#toggle() seems to work.
Is there a way to turn it on for the current file without having to create a file at ~/.vim/after/syntax/foo.vim?
Currently, there's no css_color#toggle() function defined for me (a Markdown file opened in nvim v0.4.3).