From f28138ac1497be61832a746c93c7ff045bd76d46 Mon Sep 17 00:00:00 2001 From: Guillaume DOTT Date: Wed, 20 Mar 2013 17:38:19 +0100 Subject: [PATCH] vim: deactivate foldmethod=syntax in insert mode --- vim/vimrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vim/vimrc b/vim/vimrc index a34abff..b8f95c3 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -190,6 +190,11 @@ let php_htmlInStrings = 1 au Filetype css vertical resize 50 +" Don't screw up folds when inserting text that might affect them, until +" leaving insert mode. Foldmethod is local to the window. +autocmd InsertEnter * let w:last_fdm=&foldmethod | setlocal foldmethod=manual +autocmd InsertLeave * let &l:foldmethod=w:last_fdm + " chmod +x on the file if it starts with a shebang function! ModeChange() if getline(1) =~ "^#!"