mephux / vim-jsfmt

Vim plugin for jsfmt. Auto format js code on save.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vim-jsfmt

vim-jsfmt is a vim plugin for the formatiting tool jsfmt. vim-jsfmt is based on the go-fmt vimscript that ships with the vim-go plugin.

Installation

** Note: You have to have jsfmt install for this to work. npm install -g jsfmt >= version 0.5.3

Download zip file:

To install using Vundle:

" add this line to your .vimrc file
Plugin 'mephux/vim-jsfmt'

To install using pathogen.vim:

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

To checkout the source from repository:

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

Settings

By default vim-jsfmt shows errors for the jsfmt command, to disable it:

let g:js_fmt_fail_silently = 1

Enable auto fmt on save:

let g:js_fmt_autosave = 1

Set the command to use for formating.

let g:js_fmt_command = "jsfmt"

Configure jsfmt cli options.

let g:js_fmt_options = '--no-format'

Self-Promotion

Like vim-jsfmt.vim? Follow the repository on GitHub and if you would like to stalk me, follow mephux on Twitter and GitHub.

About

Vim plugin for jsfmt. Auto format js code on save.


Languages

Language:Vim Script 100.0%