vim-jsbeautify : Simple javascript formater base on js-beautify
script karma |
Rating 20/9,
Downloaded by 1682 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
Maksim Ryzhikov |
|
script type |
utility |
|
description |
vim-jsbeautify.vim
============
LINK ON GITHUB: https://github.com/maksimr/vim-jsbeautify
## About
Vim plugin based on js-beautify
For more info, online demo and tests see [http://jsbeautifier.org/](online javascript beautifier)
Installation
------------
### With Pathogen
```
cd ~/.vim/bundle
git clone https://github.com/maksimr/vim-jsbeautify.git
cd vim-jsbeautify && git submodule foreach git pull
```
### With Vundle
Add this to .vimrc:
```vim
Bundle 'maksimr/vim-jsbeautify'
" and go to plugin direcotory and run git submodule foreach git pull
```
or (recomended)
```vim
Bundle 'maksimr/vim-jsbeautify'
Bundle 'einars/js-beautify'
" set path to js-beautify file
let g:jsbeautify_file = fnameescape(fnamemodify(expand("<sfile>"), ":h")."/bundle/js-beautify/beautify.js")
```
Configuration
-------------
Configuration jsbeautify
```vim
".vimrc
let g:jsbeautify = {"indent_size": 4, "indent_char": "\t"}
```
Run on v8
```vim
".vimrc
" by default
let g:jsbeautify_engine = "node"
" If you bin name for node is nodejs
let g:jsbeautify_engine = "nodejs"
let g:jsbeautify_engine = "v8"
" or if you have other alias
let g:jsbeautify_engine = "v8-alias"
```
Usage
```vim
".vimrc
map <c-f> :call JsBeautify()<cr>
```
Function JsBeautify takes two parameters. First `start line` second `end line`,
by default `start line` equal '0' and `end line` equal '$'
(version: 0.1)
|
|
install details |
|
|
script versions (upload new version)
Click on the package to download.
ip used for rating: 52.14.186.192
|