Last Updated: February 25, 2016
·
453
· rane

CSScomb with vim

The official vim plugin is outdated and uses the old PHP implementation.

For anyone looking, here's an easy way to use csscomb installed with npm. No plugins needed.

Put this in .vimrc (or wherever appropriate) and use F5 to run buffer through csscomb.

It will naturally use the project .csscomb.json if available.

autocmd FileType scss,css nnoremap <buffer> <F5> :call CSScomb()<CR>
function! CSScomb()
  execute "silent !csscomb " . expand('%')
  redraw!
endfunction