Plug 'octol/vim-cpp-enhanced-highlight'
Plug 'raimondi/delimitmate'
Plug 'ram-z/vim-clang-format', { 'branch': 'fix-undo' }
+" fix some issue with vim-clang-format not finding .clang-format
+let g:clang_format#detect_style_file = 1
Plug 'vimwiki/vimwiki', { 'branch': 'dev' }
Plug 'scrooloose/syntastic'
Plug 'sgeb/vim-diff-fold'
Plug 'shougo/unite.vim'
-Plug 'shougo/vimproc.vim'
+Plug 'shougo/vimproc.vim', {'do': 'make'}
Plug 'sjl/gundo.vim'
Plug 'thinca/vim-qfreplace'
Plug 'tomtom/tcomment_vim'
Plug 'vim-scripts/mediawiki.vim'
Plug 'vim-scripts/replacewithregister'
Plug 'vim-scripts/yankring.vim'
+Plug 'wincent/loupe'
" colorschemes
Plug 'morhetz/gruvbox'
Plug 'kana/vim-operator-user'
" staging
-" find an alternative (latex-box? Automatic Latex Plugin?)
-Plug 'vim-latex/vim-latex'
-Plug 'alx741/vinfo'
-" needs editing colorscheme
-" Plug 'jeaye/color_coded'
" Check LucHermites plugins: https://github.com/LucHermitte/lh-cpp
-Plug 'wincent/loupe'
call plug#end()
au!
au TerminalOpen * if &buftype == 'terminal' | setlocal bufhidden=hide | endif
augroup END
-" vertical split TermDebug
-let g:termdebug_wide = 1
-command! -nargs=* -bang -complete=file Debug tabedit % | Termdebug<bang> <args>
" bindings {{{1
map <space> <leader>
" make
-nnoremap <leader>r :make!<cr>
-nnoremap <leader><cr> :make!<cr>
+function! Make()
+ let l:make_dir = ""
+ if exists("b:make_dir")
+ let l:make_dir = "-C ".b:make_dir
+ elseif exists("g:make_dir")
+ let l:make_dir = "-C ".g:make_dir
+ endif
+
+ let l:make_targets = ""
+ if exists("g:make_targets")
+ let l:make_targets = g:make_targets
+ endif
+ execute "make! ".l:make_dir." ".l:make_targets
+endf
+nnoremap <leader>r :call Make()<cr>
" unhighlight search
nnoremap <silent> <Leader>/ :silent nohl<CR>
cnoremap <C-E> <End>
" proper movement when lines are wrapped
-noremap <expr> j (v:count == 0 ? 'gj' : 'j')
-noremap <expr> k (v:count == 0 ? 'gk' : 'k')
+noremap <silent><expr> j (v:count == 0 ? 'gj' : 'j')
+noremap <silent><expr> k (v:count == 0 ? 'gk' : 'k')
" disable arrows
noremap <Up> <NOP>
let g:syntastic_always_populate_loc_list=1
nmap <silent> <leader>y :SyntasticCheck<cr>
+let g:syntastic_cpp_clang_tidy_post_args = "-p build*"
+
if ! &diff
let g:syntastic_check_on_open=1
endif
" vim-json {{{2
let g:vim_json_syntax_conceal = 0
-" vim-latex {{{2
-let g:tex_flavor='latex'
-let g:Tex_DefaultTargetFormat='pdf'
-let g:Tex_MultipleCompileFormats='pdf'
-
" vim-sneak {{{2
let g:sneak#streak = 1
let g:sneak#target_labels = "aoeuisnthdpylrcgfqjkxzmwvz" " dvorak