Permalink
Browse files

Added fold section

  • Loading branch information...
dogeared committed Dec 29, 2012
1 parent 602af2e commit deb02cac7ec8e0482468690a3ed838101b801141
Showing with 13 additions and 0 deletions.
  1. +13 −0 vimrc
View
13 vimrc
@@ -41,6 +41,19 @@ Bundle 'cucumber.zip'
" Clojure
Bundle 'VimClojure'
+" Javascript folding
+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()
+
set ar
set expandtab
set hid

0 comments on commit deb02ca

Please sign in to comment.