]> git.rmz.io Git - dotfiles.git/blobdiff - vim/vimrc
vim: add vim-gtest plugin
[dotfiles.git] / vim / vimrc
index 933806716e92557e5b4191a10fd934a010ebd03d..7c9166da51b4c654e507cc966702c335059fac25 100644 (file)
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -69,9 +69,14 @@ 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 'alepez/vim-gtest'
 
 call vundle#end()
 
@@ -156,10 +161,18 @@ set mouse=rnv                   " list of flags for using the mouse
 set ttymouse=xterm              " type of mouse
 
 " messages and info {{{2
-set showcmd                     " Show (partial) command in status line.
-set ruler                       " show the cursor position all the time
-set confirm                     " Ask what to do when closing unsaved documents
-set shortmess=filnxtoOI         " don't show intro message
+set showcmd         " Show (partial) command in status line.
+set ruler           " show the cursor position all the time
+set confirm         " Ask what to do when closing unsaved documents
+set shortmess=      " reset option
+set shortmess+=a    " all abbreviations
+set shortmess+=o    " overwrite file-written message
+set shortmess+=O    " file-read message overrides previous
+set shortmess+=t    " truncate file message at start
+set shortmess+=T    " truncate other messages in the middle
+set shortmess+=W    " don't give 'written' or '[w]' when writing a file
+set shortmess+=A    " ignore swapfile warning
+set shortmess+=I    " no splash screen
 
 " editing text {{{2
 set backspace=indent,eol,start  " allow backspacing over everything in insert mode
@@ -206,8 +219,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
@@ -466,7 +479,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
@@ -479,9 +492,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
 
@@ -705,6 +715,12 @@ let g:ycm_autoclose_preview_window_after_insertion = 0
 vmap <Enter> <Plug>(EasyAlign)
 nmap ga <Plug>(EasyAlign)
 
+" vim-gtest {{{2
+let g:gtest#highlight_failing_tests = 0
+
+nnoremap <Leader>tt :GTestRun<CR>
+nnoremap <Leader>tu :GTestRunUnderCursor<CR>
+
 " vim-json {{{2
 let g:vim_json_syntax_conceal = 0
 
@@ -732,6 +748,15 @@ xmap T <Plug>Sneak_T
 omap t <Plug>Sneak_t
 omap T <Plug>Sneak_T
 
+" vimviki {{{2
+let g:vimwiki_list = [{'path': '$XDG_DATA_HOME/vimwiki'}]
+let g:vimwiki_auto_chdir = 1
+augroup myvimwiki
+  au! BufRead            $XDG_DATA_HOME/vimwiki/index.wiki   !git -C "%:p:h" pull
+  au! BufRead,BufNewFile $XDG_DATA_HOME/vimwiki/diary/*.wiki !git -C "%:p:h" pull
+  au! BufWritePost       $XDG_DATA_HOME/vimwiki/*.wiki       exe  '!git add "<afile>";git commit -m"' . strftime("%FT%R") . '";git push'
+augroup END
+
 " functions {{{1
 
 " Convenient command to see the difference between the current buffer and the