Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using vim with CleverCSS and was wondering if anyone has made a CleverCSS vim syntax file, or if I should make my own. Thank you!

-Nate

share|improve this question

3 Answers 3

up vote 1 down vote accepted

I just tried a quick search an came up with nothing. My guess is the time spent trying to find one is longer than just writing one. I've never used CleverCSS, but it looks very simple. I would write my own. Let me know if you need help getting started, but syntax files in vi are pretty easily defined.

share|improve this answer
1  
i'd wonder if there's a basic CSS syntax file to start from (under my assumption that CleverCSS is essentially a CSS subset). although CleverCSS seems semi-python-esque, so maybe a python syntax file is more appropriate. –  quack quixote Oct 26 '09 at 17:28
1  
Knowing nothing about CleverCSS, I took some of the examples from the website & about all the tags, classes, ids, rbg color id's and some attibutes had correct syntax highlight with the css.vim that came with vim 7.2. I think the attributes need work. Also you'd need to add variable support - in background_color = #ccc - only the color spec gets syntax highlight. And nothing is done with background-color: $background_color. If you took anything from the python.vim, it would be the function python_highlight_space_errors –  DaveParillo Oct 26 '09 at 20:25
1  
I take back my comment! Playing around with it a bit, I think it would be easier to make a modified version of the python.vim to handle the varying syntax rather than the other way around. The css.vim is pretty tough to modify. Even though all of the css keywords & attributes need to be handled (match where possible, keyword where must) I think the python file is a short and understandable starting point. –  DaveParillo Oct 26 '09 at 22:08

I've started work on a Vim syntax file for CleverCSS:

http://bitbucket.org/zakj/vim-clevercss/src/tip/clevercss.vim

It's far from perfect, but it scratched my itch enough that I haven't felt compelled to improve it further.

share|improve this answer

I wrote a syntax highlight definition file for CleanCSS (really similar syntax) for the Kate text editor http://github.com/mtorromeo/kate-syntax-files/blob/master/ccss.xml

I don't know about vi syntax files but maybe you can get inspiration from it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.