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*