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
CSScomb is written in pure JavaScript. Install with:
npm install -g csscombcd ~/.vim/bundle
git clone https://github.com/miripiruni/CSScomb-for-Vim.git
Add this to .vimrc:
Bundle 'git://github.com/miripiruni/CSScomb-for-Vim.git'
Add this to .vimrc:
NeoBundle 'faceleg/vim-csscomb', {
\ 'build': {
\ 'unix': 'npm install -g csscomb',
\ 'mac': 'npm install -g csscomb'
\ }}
git clone https://github.com/miripiruni/CSScomb-for-Vim.git csscomb
cp -r csscomb/plugin/* ~/.vim/plugin/
Vim command:
:CSScomb
"mnemonic: 'beatify css'
autocmd FileType css noremap <buffer> <leader>bc :CSScomb<CR>
" Automatically comb your CSS on save
autocmd BufWritePre,FileWritePre *.css,*.scss,*.sass silent! :CSScomb<CR>