aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-12-23 19:40:40 +1300
committerTom Ryder <tom@sanctum.geek.nz>2019-12-23 19:40:40 +1300
commitec5357c4fd006ba4a1d01f8700b629092e459161 (patch)
treee0f50eb80f4eb420938b2f1ae3292f2402050ad4
parentReshape autoloads into noun#Verb() pattern (diff)
downloaddotfiles-ec5357c4fd006ba4a1d01f8700b629092e459161.tar.gz
dotfiles-ec5357c4fd006ba4a1d01f8700b629092e459161.zip
Centralize default 'foldlevel'
-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.vim3
-rw-r--r--vim/ftplugin/awk.vim3
-rw-r--r--vim/ftplugin/markdown.vim3
-rw-r--r--vim/ftplugin/sed.vim3
-rw-r--r--vim/vimrc5
10 files changed, 19 insertions, 23 deletions
diff --git a/vim/after/ftplugin/c.vim b/vim/after/ftplugin/c.vim
index f082ca18..ea220e65 100644
--- a/vim/after/ftplugin/c.vim
+++ b/vim/after/ftplugin/c.vim
@@ -6,10 +6,9 @@ let b:undo_ftplugin .= '|setlocal commentstring< define< include<'
setlocal complete+=d
let b:undo_ftplugin .= '|setlocal complete<'
-" Fold based on indent level, but start with all folds open
+" Fold based on indent level
setlocal foldmethod=indent
-setlocal foldlevel=99
-let b:undo_ftplugin .= '|setlocal foldmethod< foldlevel<'
+let b:undo_ftplugin .= '|setlocal foldmethod<'
" Include system headers on UNIX
if has('unix')
diff --git a/vim/after/ftplugin/perl.vim b/vim/after/ftplugin/perl.vim
index 611af62c..9333e234 100644
--- a/vim/after/ftplugin/perl.vim
+++ b/vim/after/ftplugin/perl.vim
@@ -7,10 +7,9 @@ if executable('perltidy')
let b:undo_ftplugin .= '|setlocal equalprg<'
endif
-" Fold based on indent level, but start with all folds open
+" Fold based on indent level
setlocal foldmethod=indent
-setlocal foldlevel=99
-let b:undo_ftplugin .= '|setlocal foldmethod< foldlevel<'
+let b:undo_ftplugin .= '|setlocal foldmethod<'
" 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 20d8d42e..b747a14e 100644
--- a/vim/after/ftplugin/php.vim
+++ b/vim/after/ftplugin/php.vim
@@ -12,10 +12,9 @@ setlocal comments=s1:/*,m:*,ex:*/,://,:#
setlocal formatoptions+=or
let b:undo_ftplugin .= '|setlocal comments< formatoptions<'
-" Fold based on indent level, but start with all folds open
+" Fold based on indent level
setlocal foldmethod=indent
-setlocal foldlevel=99
-let b:undo_ftplugin .= '|setlocal foldmethod< foldlevel<'
+let b:undo_ftplugin .= '|setlocal foldmethod<'
" Use pman as 'keywordprg'
setlocal keywordprg=pman
diff --git a/vim/after/ftplugin/sh.vim b/vim/after/ftplugin/sh.vim
index 39b8d0d6..2c68d83a 100644
--- a/vim/after/ftplugin/sh.vim
+++ b/vim/after/ftplugin/sh.vim
@@ -3,10 +3,9 @@ setlocal comments=:#
setlocal formatoptions+=or
let b:undo_ftplugin .= '|setlocal comments< formatoptions<'
-" Fold based on indent level, but start with all folds open
+" Fold based on indent level
setlocal foldmethod=indent
-setlocal foldlevel=99
-let b:undo_ftplugin .= '|setlocal foldmethod< foldlevel<'
+let b:undo_ftplugin .= '|setlocal foldmethod<'
" 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 481af0ec..01f971b9 100644
--- a/vim/after/ftplugin/vim.vim
+++ b/vim/after/ftplugin/vim.vim
@@ -9,10 +9,9 @@ endif
let b:regex_escape_flavor = 'vim'
let b:undo_ftplugin .= '|unlet b:regex_escape_flavor'
-" Fold based on indent level, but start with all folds open
+" Fold based on indent level
setlocal foldmethod=indent
-setlocal foldlevel=99
-let b:undo_ftplugin .= '|setlocal foldmethod< foldlevel<'
+let b:undo_ftplugin .= '|setlocal foldmethod<'
" 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 880c2c39..c361c859 100644
--- a/vim/after/ftplugin/zsh.vim
+++ b/vim/after/ftplugin/zsh.vim
@@ -5,5 +5,4 @@ let b:undo_ftplugin .= '|unlet b:current_compiler'
" Fold based on indent level, but start with all folds open
setlocal foldmethod=indent
-setlocal foldlevel=99
-let b:undo_ftplugin .= '|setlocal foldmethod< foldlevel<'
+let b:undo_ftplugin .= '|setlocal foldmethod<'
diff --git a/vim/ftplugin/awk.vim b/vim/ftplugin/awk.vim
index dbefa5cd..76637486 100644
--- a/vim/ftplugin/awk.vim
+++ b/vim/ftplugin/awk.vim
@@ -11,8 +11,7 @@ let b:undo_ftplugin = 'setlocal comments< formatoptions<'
" Fold based on indent level, but start with all folds open
setlocal foldmethod=indent
-setlocal foldlevel=99
-let b:undo_ftplugin .= '|setlocal foldmethod< foldlevel<'
+let b:undo_ftplugin .= '|setlocal foldmethod<'
" Specify ERE flavor for regex_escape.vim
let b:regex_escape_flavor = 'ere'
diff --git a/vim/ftplugin/markdown.vim b/vim/ftplugin/markdown.vim
index da2228b3..2b4087a5 100644
--- a/vim/ftplugin/markdown.vim
+++ b/vim/ftplugin/markdown.vim
@@ -42,8 +42,7 @@ endfunction
let b:undo_ftplugin .= '|delfunction MarkdownFold'
setlocal foldexpr=MarkdownFold()
setlocal foldmethod=expr
-setlocal foldlevel=99
-let b:undo_ftplugin .= '|setlocal foldexpr< foldmethod< foldlevel<'
+let b:undo_ftplugin .= '|setlocal foldexpr< foldmethod<'
" Spellcheck documents we're actually editing (not just viewing)
if &modifiable && !&readonly
diff --git a/vim/ftplugin/sed.vim b/vim/ftplugin/sed.vim
index 35e705a4..04d86d7d 100644
--- a/vim/ftplugin/sed.vim
+++ b/vim/ftplugin/sed.vim
@@ -11,5 +11,4 @@ let b:undo_ftplugin = 'setlocal comments< formatoptions<'
" Fold based on indent level, but start with all folds open
setlocal foldmethod=indent
-setlocal foldlevel=99
-let b:undo_ftplugin .= '|setlocal foldmethod< foldlevel<'
+let b:undo_ftplugin .= '|setlocal foldmethod<'
diff --git a/vim/vimrc b/vim/vimrc
index 7daa54b6..601341f0 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -466,6 +466,11 @@ set confirm
"
set noesckeys
+" Always start with 'foldlevel' set high enough to have all folds of any
+" practical depth open by default.
+"
+set foldlevel=256
+
" Automatic text wrapping options using flags in the 'formatoptions' option
" begin here. I rely on the filetype plugins to set the ‘t’ and ‘c’ flags for
" this option to configure whether text or comments should be wrapped, as