From 71db2440d9e3fad1b6b5b7a53a571aa1c0e01615 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Sat, 30 Nov 2019 12:04:57 -0600 Subject: [PATCH] .vimrc: Don't use modelines to set foldmethod=expr for autofolds Newer versions of Vim prevent using `foldmethod` in modeline options when `modelineexpr` is off. Shift to using autocmd's to enable autofolds in the relevant file-types. --- .bashrc | 1 - .vimrc | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bashrc b/.bashrc index 4202d0c..8bb830f 100644 --- a/.bashrc +++ b/.bashrc @@ -468,4 +468,3 @@ test -n "$INTERACTIVE" -a -n "$LOGIN" && { } # vim: ts=4 sts=4 shiftwidth=4 expandtab -# vim: foldmethod=expr foldexpr=autofolds#foldexpr(v\:lnum,'sh') foldtext=autofolds#foldtext() foldlevel=2 diff --git a/.vimrc b/.vimrc index 63c6ccb..4e08b35 100644 --- a/.vimrc +++ b/.vimrc @@ -521,6 +521,9 @@ augroup vimrc_filetype au FileType javascript setlocal nocindent " makefiles: use real tabs au FileType make setlocal noexpandtab + " autofolds + au FileType vim setlocal foldmethod=expr foldexpr=autofolds#foldexpr(v\:lnum) foldtext=autofolds#foldtext() foldlevel=2 + au FileType sh setlocal foldmethod=expr foldexpr=autofolds#foldexpr(v\:lnum,'sh') foldtext=autofolds#foldtext() foldlevel=2 augroup END " -------------------------------------------------------------------------- @@ -530,5 +533,3 @@ augroup END if filereadable(glob("~/.vimrc.local")) source ~/.vimrc.local endif - -" vim: foldmethod=expr foldexpr=autofolds#foldexpr(v\:lnum) foldtext=autofolds#foldtext() foldlevel=2 -- 2.45.2