From 356193d89d3c0028f3726fb2183928721aae876b Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Wed, 12 Jun 2013 02:37:26 +0200 Subject: [PATCH] enable folding --- vim/.gitignore | 1 + vimrc | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/vim/.gitignore b/vim/.gitignore index a0e76af..cf617c3 100644 --- a/vim/.gitignore +++ b/vim/.gitignore @@ -1 +1,2 @@ .netrwhist +view diff --git a/vimrc b/vimrc index 3170bb3..baf2aed 100644 --- a/vimrc +++ b/vimrc @@ -155,6 +155,17 @@ imap ii " Press `` to toggle insert and replace mode (no key on Mac keyboard) imap `` +" fold between {{{ }}} +set foldmethod=marker +set foldlevelstart=99 +" space will toggle current fold in normal mode, if not in a fold, normal +" behaviour +nnoremap @=(foldlevel('.')?'za':"\") +vnoremap zf +" save and restore folds +autocmd BufWinLeave *.* mkview +autocmd BufWinEnter *.* silent loadview + " Jump to the next or previous line that has the same level or a lower " level of indentation than the current line. " -- 2.48.1