aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vimrc64
1 files changed, 53 insertions, 11 deletions
diff --git a/vimrc b/vimrc
index a26e162..ab22a28 100644
--- a/vimrc
+++ b/vimrc
@@ -13,6 +13,14 @@ Plug 'tpope/vim-surround' | " plugin makes cs"' insi
13Plug 'tpope/vim-fugitive' | " the most complete GIT integration plugin 13Plug 'tpope/vim-fugitive' | " the most complete GIT integration plugin
14Plug 'godlygeek/tabular' | " align code on a sign, like :Tab/= 14Plug 'godlygeek/tabular' | " align code on a sign, like :Tab/=
15Plug 'mhinz/vim-signify' | " show changes in the clutter bar 15Plug 'mhinz/vim-signify' | " show changes in the clutter bar
16Plug 'jlanzarotta/bufexplorer'
17" Plug 'wting/gitsessions.vim'
18Plug 'rkitover/vimpager'
19Plug 'mtth/scratch.vim'
20
21nnoremap <F12> :ToggleBufExplorer<CR>
22nnoremap <F2> :ScratchPreview<CR>
23nnoremap <F6> :syntax sync fromstart<CR>|:nohlsearch
16 24
17 25
18" AIRLINE: ===========================================. 26" AIRLINE: ===========================================.
@@ -65,6 +73,7 @@ let g:netrw_altv = 1 | " open files on the righ
65" NERDTree: ==========================================. 73" NERDTree: ==========================================.
66Plug 'scrooloose/nerdtree' | " replace NetRW, which is kind of buggy 74Plug 'scrooloose/nerdtree' | " replace NetRW, which is kind of buggy
67let NERDTreeCascadeSingleChildDir = 0 | " I don't get how one can use <m> to create files in that included directory 75let NERDTreeCascadeSingleChildDir = 0 | " I don't get how one can use <m> to create files in that included directory
76let NERDTreeShowBookmarks = 1 | " show bookmarks by default (when opening for the first time)
68let NERDTreeIgnore = ['\.aux$'] 77let NERDTreeIgnore = ['\.aux$']
69set winwidth=30 " keep NERDTreeWindow at least this size 78set winwidth=30 " keep NERDTreeWindow at least this size
70set winminwidth=30 " (and all other windows, so TODO: watch out) 79set winminwidth=30 " (and all other windows, so TODO: watch out)
@@ -108,6 +117,7 @@ let g:tagbar_compact = 0
108let g:tagbar_indent = 0 117let g:tagbar_indent = 0
109let g:tagbar_foldlevel = 99 118let g:tagbar_foldlevel = 99
110nnoremap <leader>l :TagbarToggle<CR>| " bind TagBar to Hotkey Ctrl+L 119nnoremap <leader>l :TagbarToggle<CR>| " bind TagBar to Hotkey Ctrl+L
120nnoremap <F9> :TagbarToggle<CR>| " bind TagBar to Hotkey Ctrl+L
111 121
112 122
113" Autocompleter: =====================================. 123" Autocompleter: =====================================.
@@ -124,10 +134,11 @@ let g:ycm_warning_symbol = '➔' " insert this as a warni
124let g:ycm_confirm_extra_conf = 0 " security is overrated 134let g:ycm_confirm_extra_conf = 0 " security is overrated
125let g:ycm_key_list_select_completion = ['<Down>'] 135let g:ycm_key_list_select_completion = ['<Down>']
126let g:ycm_key_list_previous_completion = ['<Up>'] 136let g:ycm_key_list_previous_completion = ['<Up>']
137let g:ycm_global_ycm_extra_conf = '~/src/.ycm_extra_conf.py'
127" disable <tab>-key for YCM so that it can be used with ultisnips 138" disable <tab>-key for YCM so that it can be used with ultisnips
128" let g:ycm_key_list_select_completion=[] 139" let g:ycm_key_list_select_completion=[]
129" let g:ycm_key_list_previous_completion=[] 140" let g:ycm_key_list_previous_completion=[]
130Plug 'rdnetto/YCM-Generator' 141" Plug 'rdnetto/YCM-Generator'
131 142
132" Plug 'ervandew/supertab' 143" Plug 'ervandew/supertab'
133 144
@@ -276,13 +287,14 @@ set scrolljump=5 | " how many lines get scrolled into view when cur
276set splitbelow | " open new windows below the current one (i find that more intuitive) 287set splitbelow | " open new windows below the current one (i find that more intuitive)
277set shiftround | " indent/unindent snaps to multiple of shiftwidth 288set shiftround | " indent/unindent snaps to multiple of shiftwidth
278set showcmd | " essential: show keys of combined commands in the lower right corner 289set showcmd | " essential: show keys of combined commands in the lower right corner
290set tags+=../tags
279set t_Co=256 | " required on some ssh sessions 291set t_Co=256 | " required on some ssh sessions
280" set textwidth=100 | " line length (80 used to be default, but...) 292" set textwidth=100 | " line length (80 used to be default, but...)
281set textwidth=120 | " @IPQ 293set textwidth=120 | " better done with modeline
282set colorcolumn=120 | " @IPQ 294set colorcolumn=120 | " better done with modeline
283set thesaurus+=/home/max/.vim/thesaurus/php.txt 295set thesaurus+=/home/max/.vim/thesaurus/php.txt
284set ts=4 sts=4 sw=4 expandtab | " @IPQ 296set ts=4 sts=4 sw=4 expandtab | " better done with a modeline
285set ttimeoutlen=50 | " set esc key timeout in ms- 297set ttimeoutlen=10 | " set esc key timeout in ms-
286set updatetime=1000 | " updates the screen more often 298set updatetime=1000 | " updates the screen more often
287set writedelay=0 299set writedelay=0
288 300
@@ -331,10 +343,10 @@ if has("autocmd")
331 autocmd BufWritePost $MYVIMRC source $MYVIMRC 343 autocmd BufWritePost $MYVIMRC source $MYVIMRC
332 augroup END " } 344 augroup END " }
333 345
334 augroup remove_whitespaces " { 346 " augroup remove_whitespaces " {
335 " automatically remove trailing white spaces on save.. 347 " " automatically remove trailing white spaces on save..
336 autocmd BufWritePre * %s/\s\+$//e 348 " autocmd BufWritePre * %s/\s\+$//e
337 augroup END " } 349 " augroup END " }
338 350
339 augroup set_window_title " { 351 augroup set_window_title " {
340 " autocmd BufWinEnter quickfix setl statusline=%t 352 " autocmd BufWinEnter quickfix setl statusline=%t
@@ -404,8 +416,8 @@ if has("autocmd")
404 augroup ChangeIcon 416 augroup ChangeIcon
405 "if filereadable("/usr/bin/xseticon") 417 "if filereadable("/usr/bin/xseticon")
406 "if filereadable("~/.vim/nvim.png") 418 "if filereadable("~/.vim/nvim.png")
407 autocmd VimEnter * silent :execute "!xseticon -id $WINDOWID ~/.vim/nvim.png" 419 " autocmd VimEnter * silent :execute "!xseticon -id $WINDOWID ~/.vim/nvim.png"
408 autocmd VimLeave * silent :execute "!xseticon -id $WINDOWID /usr/share/icons/gnome/32x32/apps/xfce-terminal.png" 420 " autocmd VimLeave * silent :execute "!xseticon -id $WINDOWID /usr/share/icons/gnome/32x32/apps/xfce-terminal.png"
409 "endif 421 "endif
410 "endif 422 "endif
411 augroup END 423 augroup END
@@ -417,6 +429,36 @@ if has("autocmd")
417 autocmd VimLeave * call system("echo -n $'" . escape(getreg(), "'") . "' | xsel -ib") 429 autocmd VimLeave * call system("echo -n $'" . escape(getreg(), "'") . "' | xsel -ib")
418 augroup END 430 augroup END
419 endif 431 endif
432
433
434 augroup ToggleQuickFix
435 function! ToggleQuickFix()
436 if exists("g:qwindow")
437 lclose
438 unlet g:qwindow
439 else
440 try
441 lopen 10
442 let g:qwindow = 1
443 catch
444 echo "No Errors found!"
445 endtry
446 endif
447 endfunction
448 function! QFixToggle(forced)
449 if exists("g:qfix_win") && a:forced == 0
450 cclose
451 unlet g:qfix_win
452 else
453 copen 10
454 let g:qfix_win = bufnr("$")
455 endif
456 endfunction
457
458 nmap <script> <silent> <F3> :call ToggleQuickFix()<CR>
459 nmap <script> <silent> <F4> :call QFixToggle(0)<CR>
460 augroup END
461
420 "set omnifunc=syntaxcomplete#Complete 462 "set omnifunc=syntaxcomplete#Complete
421 " au BufNewFile,BufRead,BufEnter *.cpp,*.hpp set omnifunc=omni#cpp#complete#Main 463 " au BufNewFile,BufRead,BufEnter *.cpp,*.hpp set omnifunc=omni#cpp#complete#Main
422 " Enable omni completion. 464 " Enable omni completion.
..