Skip to content

Instantly share code, notes, and snippets.

@troynt
Created May 17, 2010 21:58
Show Gist options
  • Save troynt/404282 to your computer and use it in GitHub Desktop.
Save troynt/404282 to your computer and use it in GitHub Desktop.
.vimrc for code folding
" Folding
hi Folded guibg=red guifg=Red cterm=bold ctermbg=DarkGrey ctermfg=lightblue
hi FoldColumn guibg=grey78 gui=Bold guifg=DarkBlue
set foldclose=
set foldmethod=indent
set foldnestmax=10
set foldlevel=0
set fillchars=vert:\|,fold:\
set foldminlines=2
let php_folding = 1
" Toggle fold state between closed and opened.
"
" If there is no fold at current line, just moves forward.
" If it is present, reverse it's state.
fu! ToggleFold()
if foldlevel('.') == 0
normal! l
else
if foldclosed('.') < 0
. foldclose
else
. foldopen
endif
endif
echo
endf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment