CSScomb plugin for Vim. Tool for sorting CSS properties in specific order.
Vim script
#14 Compare This branch is 12 commits ahead of batsuev:master.
Latest commit 3fa9363 Aug 24, 2015 @tonyganch tonyganch Merge pull request #11 from GertjanReynaert/patch-2
Fix vim configuration for auto-combing
Failed to load latest commit information.
plugin Output csscomb error if there was one, do not attempt to update file … May 23, 2015


CSScomb plugin for Vim


Plugin based on CSScomb algorithm.

The algorithm of CSScomb simulates web-technologists actions upon working with CSS-code to the limit. Usually to re-order code you move lines over each other considering comments in the code, multilines records of property values, hacks and everything that could be found in the real file. CSScomb reproduces these actions for you. This means that the parser "thinks" as a person editing the text, not as a blind robot parsing CSS.

For more info, online demo and tests see csscomb.com

The Requirements

CSScomb is written in pure JavaScript. Install with:

npm install -g csscomb


With Pathogen

cd ~/.vim/bundle
git clone https://github.com/csscomb/vim-csscomb.git

With Vundle

Add this to .vimrc:

Bundle 'git://github.com/csscomb/vim-csscomb.git'

With NeoBundle

Add this to .vimrc:

NeoBundle 'csscomb/vim-csscomb'

Manual without plugins manager

git clone https://github.com/csscomb/vim-csscomb.git csscomb
cp -r csscomb/plugin/* ~/.vim/plugin/


Vim command:


Suggested Configuration

" Map bc to run CSScomb. bc stands for beautify css
autocmd FileType css noremap <buffer> <leader>bc :CSScomb<CR>
" Automatically comb your CSS on save
autocmd BufWritePre,FileWritePre *.css,*.less,*.scss,*.sass silent! :CSScomb