aboutsummaryrefslogtreecommitdiff
path: root/vim/after/ftplugin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-19 17:02:21 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-19 17:02:21 +1200
commitcc2cd38d2405dc50bdc7184516fd0b8e0e71ade0 (patch)
treea69f9172f593bb9b5172d93741d00ce38e5ae249 /vim/after/ftplugin
parentfa6ed737961d053ee22d78d0e1c9a5575d1af171 (diff)
downloaddotfiles-cc2cd38d2405dc50bdc7184516fd0b8e0e71ade0.tar.gz
dotfiles-cc2cd38d2405dc50bdc7184516fd0b8e0e71ade0.zip
Set filetype-appropriate 'foldlevel'
Diffstat (limited to 'vim/after/ftplugin')
-rw-r--r--vim/after/ftplugin/c.vim5
-rw-r--r--vim/after/ftplugin/perl.vim5
-rw-r--r--vim/after/ftplugin/php.vim5
-rw-r--r--vim/after/ftplugin/sh.vim5
-rw-r--r--vim/after/ftplugin/vim.vim5
-rw-r--r--vim/after/ftplugin/zsh.vim5
6 files changed, 18 insertions, 12 deletions
diff --git a/vim/after/ftplugin/c.vim b/vim/after/ftplugin/c.vim
index ea220e65..bc531a61 100644
--- a/vim/after/ftplugin/c.vim
+++ b/vim/after/ftplugin/c.vim
@@ -6,9 +6,10 @@ let b:undo_ftplugin .= '|setlocal commentstring< define< include<'
setlocal complete+=d
let b:undo_ftplugin .= '|setlocal complete<'
-" Fold based on indent level
+" Fold based on indent level, and start with all folds closed
setlocal foldmethod=indent
-let b:undo_ftplugin .= '|setlocal foldmethod<'
+setlocal foldlevel=0
+let b:undo_ftplugin .= '|setlocal foldmethod< foldlevel<'
" Include system headers on UNIX
if has('unix')
diff --git a/vim/after/ftplugin/perl.vim b/vim/after/ftplugin/perl.vim
index e780bed5..5c9cf8a0 100644
--- a/vim/after/ftplugin/perl.vim
+++ b/vim/after/ftplugin/perl.vim
@@ -4,9 +4,10 @@ setlocal equalprg=perltidy
let b:undo_ftplugin .= '|unlet b:current_compiler'
\ . '|setlocal equalprg< errorformat< makeprg<'
-" Fold based on indent level
+" Fold based on indent level, but start with all folds open
setlocal foldmethod=indent
-let b:undo_ftplugin .= '|setlocal foldmethod<'
+setlocal foldlevel=99
+let b:undo_ftplugin .= '|setlocal foldmethod< foldlevel<'
" Add angle brackets to pairs of matched characters for q<...>
setlocal matchpairs+=<:>
diff --git a/vim/after/ftplugin/php.vim b/vim/after/ftplugin/php.vim
index 7bb20f99..3b023f9e 100644
--- a/vim/after/ftplugin/php.vim
+++ b/vim/after/ftplugin/php.vim
@@ -8,9 +8,10 @@ setlocal comments=s1:/*,m:*,ex:*/,://,:#
setlocal formatoptions+=or
let b:undo_ftplugin .= '|setlocal comments< formatoptions<'
-" Fold based on indent level
+" Fold based on indent level, but start with all folds open
setlocal foldmethod=indent
-let b:undo_ftplugin .= '|setlocal foldmethod<'
+setlocal foldlevel=99
+let b:undo_ftplugin .= '|setlocal foldmethod< foldlevel<'
" Use pman as 'keywordprg'
setlocal keywordprg=pman
diff --git a/vim/after/ftplugin/sh.vim b/vim/after/ftplugin/sh.vim
index 2c68d83a..39b8d0d6 100644
--- a/vim/after/ftplugin/sh.vim
+++ b/vim/after/ftplugin/sh.vim
@@ -3,9 +3,10 @@ setlocal comments=:#
setlocal formatoptions+=or
let b:undo_ftplugin .= '|setlocal comments< formatoptions<'
-" Fold based on indent level
+" Fold based on indent level, but start with all folds open
setlocal foldmethod=indent
-let b:undo_ftplugin .= '|setlocal foldmethod<'
+setlocal foldlevel=99
+let b:undo_ftplugin .= '|setlocal foldmethod< foldlevel<'
" If subtype is Bash, set 'keywordprg' to han(1df)
if exists('b:is_bash')
diff --git a/vim/after/ftplugin/vim.vim b/vim/after/ftplugin/vim.vim
index 01f971b9..481af0ec 100644
--- a/vim/after/ftplugin/vim.vim
+++ b/vim/after/ftplugin/vim.vim
@@ -9,9 +9,10 @@ endif
let b:regex_escape_flavor = 'vim'
let b:undo_ftplugin .= '|unlet b:regex_escape_flavor'
-" Fold based on indent level
+" Fold based on indent level, but start with all folds open
setlocal foldmethod=indent
-let b:undo_ftplugin .= '|setlocal foldmethod<'
+setlocal foldlevel=99
+let b:undo_ftplugin .= '|setlocal foldmethod< foldlevel<'
" Use :help as 'keywordprg' if not already set; this is the default since Vim
" v8.1.1290
diff --git a/vim/after/ftplugin/zsh.vim b/vim/after/ftplugin/zsh.vim
index 6b5a389c..880c2c39 100644
--- a/vim/after/ftplugin/zsh.vim
+++ b/vim/after/ftplugin/zsh.vim
@@ -3,6 +3,7 @@ compiler zsh
let b:undo_ftplugin .= '|unlet b:current_compiler'
\ . '|setlocal errorformat< makeprg<'
-" Fold based on indent level
+" Fold based on indent level, but start with all folds open
setlocal foldmethod=indent
-let b:undo_ftplugin .= '|setlocal foldmethod<'
+setlocal foldlevel=99
+let b:undo_ftplugin .= '|setlocal foldmethod< foldlevel<'