css color preview plugin done right
This is a post about plugin for color highlighting that I wrote.
Before writing my own I used two plugins for previewing colors. First one was skammer vim-css-color and second was a great fork from Aristotle Pagaltzis which fixed many issues from original plugin.
But there was still a bug that was very painful(at least for me). When you had cursorline on(:set cursorline
) the color behind text disappeared and the foreground was left as it is.
This was fixed in another plugin which had other problems(it didn't work with hsl(a) and it couldn't highlight named colors).
So I decided to merge the two, take good parts from both and wrote many stuff myself.
As you can see there is no problem with cursorline and still you can have multiple colors on same line
...you can type named colors in any way and they will still be highlighted
...and you can still use hsl(a).
Grab it here
or install via vundle:
Bundle 'https://github.com/gorodinskiy/vim-coloresque.git'
Don't forget to 'star' the repo!
Written by Konstantin Gorodinskiy
Related protips
2 Responses
You could have simply used my improved colorhighlight plugin: https://github.com/chrisbra/colorhighlight
I added cursorline
support to my vim-css-color fork a while back.