From 352e2b820167ff2377350683a88a69af803be78c Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 19 Jun 2019 15:24:01 +1200 Subject: Move 'foldmethod' definitions out to filetypes --- vim/after/ftplugin/c.vim | 4 ++++ vim/after/ftplugin/perl.vim | 4 ++++ vim/after/ftplugin/php.vim | 4 ++++ vim/after/ftplugin/sh.vim | 4 ++++ vim/after/ftplugin/vim.vim | 4 ++++ vim/after/ftplugin/zsh.vim | 4 ++++ 6 files changed, 24 insertions(+) (limited to 'vim/after/ftplugin') diff --git a/vim/after/ftplugin/c.vim b/vim/after/ftplugin/c.vim index dd99e81f..ea220e65 100644 --- a/vim/after/ftplugin/c.vim +++ b/vim/after/ftplugin/c.vim @@ -6,6 +6,10 @@ let b:undo_ftplugin .= '|setlocal commentstring< define< include<' setlocal complete+=d let b:undo_ftplugin .= '|setlocal complete<' +" Fold based on indent level +setlocal foldmethod=indent +let b:undo_ftplugin .= '|setlocal foldmethod<' + " Include system headers on UNIX if has('unix') setlocal path+=/usr/include diff --git a/vim/after/ftplugin/perl.vim b/vim/after/ftplugin/perl.vim index a303fa75..e780bed5 100644 --- a/vim/after/ftplugin/perl.vim +++ b/vim/after/ftplugin/perl.vim @@ -4,6 +4,10 @@ setlocal equalprg=perltidy let b:undo_ftplugin .= '|unlet b:current_compiler' \ . '|setlocal equalprg< errorformat< makeprg<' +" Fold based on indent level +setlocal foldmethod=indent +let b:undo_ftplugin .= '|setlocal foldmethod<' + " Add angle brackets to pairs of matched characters for q<...> setlocal matchpairs+=<:> let b:undo_ftplugin .= '|setlocal matchpairs<' diff --git a/vim/after/ftplugin/php.vim b/vim/after/ftplugin/php.vim index 58d83c49..7bb20f99 100644 --- a/vim/after/ftplugin/php.vim +++ b/vim/after/ftplugin/php.vim @@ -8,6 +8,10 @@ setlocal comments=s1:/*,m:*,ex:*/,://,:# setlocal formatoptions+=or let b:undo_ftplugin .= '|setlocal comments< formatoptions<' +" Fold based on indent level +setlocal foldmethod=indent +let b:undo_ftplugin .= '|setlocal foldmethod<' + " Use pman as 'keywordprg' setlocal keywordprg=pman let b:undo_ftplugin .= '|setlocal keywordprg<' diff --git a/vim/after/ftplugin/sh.vim b/vim/after/ftplugin/sh.vim index 8468b133..2c68d83a 100644 --- a/vim/after/ftplugin/sh.vim +++ b/vim/after/ftplugin/sh.vim @@ -3,6 +3,10 @@ setlocal comments=:# setlocal formatoptions+=or let b:undo_ftplugin .= '|setlocal comments< formatoptions<' +" Fold based on indent level +setlocal foldmethod=indent +let b:undo_ftplugin .= '|setlocal foldmethod<' + " If subtype is Bash, set 'keywordprg' to han(1df) if exists('b:is_bash') setlocal keywordprg=han diff --git a/vim/after/ftplugin/vim.vim b/vim/after/ftplugin/vim.vim index 30182bba..01f971b9 100644 --- a/vim/after/ftplugin/vim.vim +++ b/vim/after/ftplugin/vim.vim @@ -9,6 +9,10 @@ endif let b:regex_escape_flavor = 'vim' let b:undo_ftplugin .= '|unlet b:regex_escape_flavor' +" Fold based on indent level +setlocal foldmethod=indent +let b:undo_ftplugin .= '|setlocal foldmethod<' + " Use :help as 'keywordprg' if not already set; this is the default since Vim " v8.1.1290 if &keywordprg !=# ':help' diff --git a/vim/after/ftplugin/zsh.vim b/vim/after/ftplugin/zsh.vim index 5aa2600a..6b5a389c 100644 --- a/vim/after/ftplugin/zsh.vim +++ b/vim/after/ftplugin/zsh.vim @@ -2,3 +2,7 @@ compiler zsh let b:undo_ftplugin .= '|unlet b:current_compiler' \ . '|setlocal errorformat< makeprg<' + +" Fold based on indent level +setlocal foldmethod=indent +let b:undo_ftplugin .= '|setlocal foldmethod<' -- cgit v1.2.3