Added folding magic and views autosave and load

Define indent-based folding, after loading a file switch to manual folding
Autosave and load views
Set xml shiftwidth=2
This commit is contained in:
fedora 2019-05-29 00:46:44 +02:00
parent e3390dadf3
commit 47dbd0f288
Signed by: wanderer
GPG Key ID: 7B28D8DC28BD2388

18
vimrc
View File

@ -113,14 +113,24 @@ set showcmd " show command status
set showmatch " flashes matching parenthese when cursor over the other one set showmatch " flashes matching parenthese when cursor over the other one
set showmode " show editing mode in status (-- INSERT --) set showmode " show editing mode in status (-- INSERT --)
set ruler " show cursor position set ruler " show cursor position
set nofen
set foldmethod=indent " indent based folding
set errorbells " bells in terminal set errorbells " bells in terminal
set undolevels=1000 " number of undos stored set undolevels=1000 " number of undos stored
set viminfo='50,"50 " '=marks for x files, "=registers for x files 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 FileType c setl ofu=ccomplete#CompleteCpp
au BufNewFile,BufRead *.py,*.pyw,*.pyx,?akefil* au BufNewFile,BufRead *.py,*.pyw,*.pyx,?akefil*