javascript folding
This commit is contained in:
parent
50a420ba12
commit
7ffbe8b62f
1 changed files with 16 additions and 0 deletions
16
.vimrc
16
.vimrc
|
|
@ -644,6 +644,22 @@ if has("eval")
|
|||
noremap <Leader>ig :call MakeIncludeGuards()<CR>
|
||||
endif
|
||||
|
||||
" javascript folding
|
||||
if has("eval")
|
||||
function! JavaScriptFold()
|
||||
setl foldmethod=syntax
|
||||
setl foldlevelstart=1
|
||||
syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend
|
||||
|
||||
function! FoldText()
|
||||
return substitute(getline(v:foldstart), '{.*', '{...}', '')
|
||||
endfunction
|
||||
setl foldtext=FoldText()
|
||||
endfunction
|
||||
au FileType javascript call JavaScriptFold()
|
||||
au FileType javascript setl fen
|
||||
endif
|
||||
|
||||
" fast buffer switching
|
||||
if v:version >= 700 && has("eval")
|
||||
let g:switch_header_map = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue