]> git.rmz.io Git - dotfiles.git/blobdiff - vim/vimrc
vim: don't save/restore views all the time
[dotfiles.git] / vim / vimrc
index f1dc3f8966578b283ef9e4ec2b6713e6428b87d0..5a31115b5c49e222dd80ae6533b20c612228b642 100644 (file)
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -69,11 +69,13 @@ Plugin 'ompugao/ctrlp-ros'
 Plugin 'vim-latex/vim-latex'
 Plugin 'alx741/vinfo'
 Plugin 'derekwyatt/vim-protodef'
+Plugin 'ram-z/vim-clang-format'
+Plugin 'sgeb/vim-diff-fold'
 " needs editing colorscheme
 " Plugin 'jeaye/color_coded'
 " Check LucHermites plugins: https://github.com/LucHermitte/lh-cpp
 Plugin 'wincent/loupe'
-Plugin 'Ram-Z/vimwiki'
+Plugin 'ram-z/vimwiki'
 
 call vundle#end()
 
@@ -216,8 +218,8 @@ set foldlevelstart=0            " value for 'foldlevel' when starting to edit a
 " open folds when jumping to line
 set foldopen+=jump
 
-" save and restore folds
-set viewoptions=cursor          " only save cursor position
+set viewoptions=cursor          " save cursor position
+set viewoptions+=folds          " save folds
 
 " diff mode {{{2
 set diffopt+=filler         " show filler lines
@@ -476,7 +478,7 @@ nnoremap [oe :set expandtab<CR>
 nnoremap ]oe :set noexpandtab<CR>
 
 for idt in range(1,8)
-  exe 'nnoremap co'.idt.' :set tabstop='.idt.' shiftwidth='.idt.' softtabstop='.idt.'<CR>'
+  exe 'nnoremap co'.idt.' :setlocal tabstop='.idt.' shiftwidth='.idt.' softtabstop='.idt.'<CR>'
 endfor
 
 " toggle auto format of text
@@ -489,9 +491,6 @@ nnoremap <leader><Space> za
 " create folds around visual selection
 vnoremap <leader><Space> zf
 
-autocmd BufWinLeave *.* mkview
-autocmd BufWinEnter *.* silent loadview
-
 " save with sudo
 cabbrev w!! w !sudo tee % > /dev/null