js beautifier
This commit is contained in:
parent
d0dbd45b5d
commit
4aa82698fb
2 changed files with 35 additions and 0 deletions
25
.editorconfig
Normal file
25
.editorconfig
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
; .editorconfig
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[**.js]
|
||||||
|
path = ~/.vim/bundle/js-beautify/js/lib/beautify.js
|
||||||
|
bin = node
|
||||||
|
ident_size=2
|
||||||
|
ident_style = space
|
||||||
|
brace_style = collapse
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
wrap_line_length = 120
|
||||||
|
max_preserve_newlines = 2
|
||||||
|
|
||||||
|
[**.css]
|
||||||
|
path = ~/.vim/bundle/js-beautify/js/lib/beautify-css.js
|
||||||
|
ident_style = space
|
||||||
|
ident_size = 2
|
||||||
|
|
||||||
|
[**.html]
|
||||||
|
ident_style = space
|
||||||
|
ident_size = 2
|
||||||
|
max_char = 120
|
||||||
|
brace_style = expand
|
10
vimrc
10
vimrc
|
@ -64,6 +64,9 @@ Bundle 'lambdatoast/elm.vim'
|
||||||
" -- reload browser on change
|
" -- reload browser on change
|
||||||
Bundle 'Bogdanp/browser-connect.vim'
|
Bundle 'Bogdanp/browser-connect.vim'
|
||||||
|
|
||||||
|
Bundle 'maksimr/vim-jsbeautify'
|
||||||
|
Bundle 'einars/js-beautify'
|
||||||
|
|
||||||
filetype on
|
filetype on
|
||||||
|
|
||||||
" ###################
|
" ###################
|
||||||
|
@ -223,3 +226,10 @@ endif
|
||||||
|
|
||||||
" --- type ° to search the word in all files in the current dir
|
" --- type ° to search the word in all files in the current dir
|
||||||
nmap ° :Ag <c-r>=expand("<cword>")<cr><cr>
|
nmap ° :Ag <c-r>=expand("<cword>")<cr><cr>
|
||||||
|
|
||||||
|
" -- js beautifer
|
||||||
|
autocmd FileType javascript noremap <buffer> <c-f> :call JsBeautify()<cr>
|
||||||
|
autocmd FileType html noremap <buffer> <c-f> :call JsBeautify()<cr>
|
||||||
|
autocmd FileType css noremap <buffer> <c-f> :call JsBeautify()<cr>
|
||||||
|
|
||||||
|
" set noswapfile
|
||||||
|
|
Loading…
Reference in a new issue