Skip to content

mirka/vim-comb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 64.1%
  • JavaScript 28.5%
  • Shell 7.4%