From 0b93c5222d364762412a5e841bf2b5d5d3cd0c21 Mon Sep 17 00:00:00 2001 From: fedora Date: Mon, 3 Jun 2019 14:43:20 +0200 Subject: [PATCH] Keeping gvimrc on par with vimrc --- gvimrc | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/gvimrc b/gvimrc index 1537d85..86839d8 100644 --- a/gvimrc +++ b/gvimrc @@ -113,14 +113,24 @@ set showcmd " show command status set showmatch " flashes matching parenthese when cursor over the other one set showmode " show editing mode in status (-- INSERT --) set ruler " show cursor position - -set nofen -set foldmethod=indent " indent based folding - set errorbells " bells in terminal set undolevels=1000 " number of undos stored set viminfo='50,"50 " '=marks for x files, "=registers for x files +set nofen +"set foldmethod=indent " indent based folding + +" define indent-based folding, after loading a file switch to manual folding +augroup vimrc + au BufReadPre * setlocal foldmethod=indent + au BufWinEnter * if &fdm == 'indent' | setlocal foldmethod=manual | endif +augroup END + +" autosave and load views +au BufWinLeave ?* mkview +au BufWinEnter ?* silent loadview + +au FileType xml setlocal shiftwidth=2 tabstop=2 au FileType c setl ofu=ccomplete#CompleteCpp au BufNewFile,BufRead *.py,*.pyw,*.pyx,?akefil*