From 94b6a34816b886e92a469a94edd9feb2a0ac49a1 Mon Sep 17 00:00:00 2001 From: gfixler Date: Tue, 17 Feb 2015 12:57:08 -0800 Subject: [PATCH] Allow opting out of folding with global variable vim2hs folds code by default. This change preserves that default, but allows adding `g:haskell_fold = 0` to your .vimrc (or similar) to opt out of folding by default on .hs file load. --- README.md | 1 + ftplugin/haskell.vim | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8899090..2c6f7e2 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,7 @@ let g:haskell_shqq = 0 let g:haskell_sql = 0 let g:haskell_json = 0 let g:haskell_xml = 0 +let g:haskell_fold = 0 ``` ### HSP & Heist diff --git a/ftplugin/haskell.vim b/ftplugin/haskell.vim index 7e37f39..f050bd7 100644 --- a/ftplugin/haskell.vim +++ b/ftplugin/haskell.vim @@ -2,7 +2,9 @@ call vim2hs#haskell#editing#includes() call vim2hs#haskell#editing#keywords() call vim2hs#haskell#editing#formatting() -call vim2hs#haskell#editing#folding() +if get(g:, 'haskell_fold', 1) == 1 + call vim2hs#haskell#editing#folding() +endif if executable('hlint') command! -buffer -nargs=* HLint call vim2hs#with_compiler('hlint', )