mirka / vim-comb

A vim plugin for csscomb.js

Repository from Github https://github.commirka/vim-combRepository from Github https://github.commirka/vim-comb

vim-comb

vim-comb is a vim bridge to csscomb.js, a coding style formatter for CSS (and its various pre-processors). csscomb.js replaces the deprecated csscomb.

Requirements

You will need node installed so that this pluging can install a copy of csscomb.js, which is a node.js package. On Mac OS X with homebrew installed, you can get set up with:

brew install node

Installation

With vim-plug

Add this to .vimrc:

Plug 'danhodos/vim-comb',  {'do': './install.sh'}

and run :PlugInstall

With Pathogen

cd ~/.vim/bundle
git clone https://github.com/danhodos/vim-comb.git
vim-comb/install.sh

Usage

Because vim-comb is implemented using a formatexpr that is set for CSS (and CSS-like files, e.g. SCSS), you can use the standard gq with a motion (or after making a visual selection) to format your code through csscomb.js.

If csscomb.js returns an error (say, for instance, if you encounter this problem), then the error will be displayed without changing the contents of the buffer.

Configuration

vim-comb will look for a file named .csscomb.json in your project directory. If it cannot find one, it will use a stock pre-defined configuration file.

The format of the .csscomb.json file is documented on the CSScomb site.

Acknowledgments

The vim portion of this plugin was originally based on that of vim-csscomb.

About

A vim plugin for csscomb.js

License:MIT License


Languages

Language:Vim Script 64.1%Language:JavaScript 28.5%Language:Shell 7.4%