diff options
author | Max Christian Pohle | 2017-03-28 17:19:47 +0200 |
---|---|---|
committer | Max Christian Pohle | 2017-03-28 17:19:47 +0200 |
commit | 06499260aeac6e84f0674e3d780a7ad84938841e (patch) | |
tree | 22b5371e38557ec3b4a6370d8335d03837cfddb8 /vimrc | |
parent | ee79380632f656c3ddc3e71a8272385e5fd61ee1 (diff) | |
download | vim-06499260aeac6e84f0674e3d780a7ad84938841e.tar.bz2 vim-06499260aeac6e84f0674e3d780a7ad84938841e.zip |
use f-keys to toggle some default windows
Diffstat (limited to 'vimrc')
-rw-r--r-- | vimrc | 64 |
1 files changed, 53 insertions, 11 deletions
@@ -13,6 +13,14 @@ Plug 'tpope/vim-surround' | " plugin makes cs"' insi | |||
13 | Plug 'tpope/vim-fugitive' | " the most complete GIT integration plugin | 13 | Plug 'tpope/vim-fugitive' | " the most complete GIT integration plugin |
14 | Plug 'godlygeek/tabular' | " align code on a sign, like :Tab/= | 14 | Plug 'godlygeek/tabular' | " align code on a sign, like :Tab/= |
15 | Plug 'mhinz/vim-signify' | " show changes in the clutter bar | 15 | Plug 'mhinz/vim-signify' | " show changes in the clutter bar |
16 | Plug 'jlanzarotta/bufexplorer' | ||
17 | " Plug 'wting/gitsessions.vim' | ||
18 | Plug 'rkitover/vimpager' | ||
19 | Plug 'mtth/scratch.vim' | ||
20 | |||
21 | nnoremap <F12> :ToggleBufExplorer<CR> | ||
22 | nnoremap <F2> :ScratchPreview<CR> | ||
23 | nnoremap <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: ==========================================. |
66 | Plug 'scrooloose/nerdtree' | " replace NetRW, which is kind of buggy | 74 | Plug 'scrooloose/nerdtree' | " replace NetRW, which is kind of buggy |
67 | let NERDTreeCascadeSingleChildDir = 0 | " I don't get how one can use <m> to create files in that included directory | 75 | let NERDTreeCascadeSingleChildDir = 0 | " I don't get how one can use <m> to create files in that included directory |
76 | let NERDTreeShowBookmarks = 1 | " show bookmarks by default (when opening for the first time) | ||
68 | let NERDTreeIgnore = ['\.aux$'] | 77 | let NERDTreeIgnore = ['\.aux$'] |
69 | set winwidth=30 " keep NERDTreeWindow at least this size | 78 | set winwidth=30 " keep NERDTreeWindow at least this size |
70 | set winminwidth=30 " (and all other windows, so TODO: watch out) | 79 | set winminwidth=30 " (and all other windows, so TODO: watch out) |
@@ -108,6 +117,7 @@ let g:tagbar_compact = 0 | |||
108 | let g:tagbar_indent = 0 | 117 | let g:tagbar_indent = 0 |
109 | let g:tagbar_foldlevel = 99 | 118 | let g:tagbar_foldlevel = 99 |
110 | nnoremap <leader>l :TagbarToggle<CR>| " bind TagBar to Hotkey Ctrl+L | 119 | nnoremap <leader>l :TagbarToggle<CR>| " bind TagBar to Hotkey Ctrl+L |
120 | nnoremap <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 | |||
124 | let g:ycm_confirm_extra_conf = 0 " security is overrated | 134 | let g:ycm_confirm_extra_conf = 0 " security is overrated |
125 | let g:ycm_key_list_select_completion = ['<Down>'] | 135 | let g:ycm_key_list_select_completion = ['<Down>'] |
126 | let g:ycm_key_list_previous_completion = ['<Up>'] | 136 | let g:ycm_key_list_previous_completion = ['<Up>'] |
137 | let 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=[] |
130 | Plug '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 | |||
276 | set splitbelow | " open new windows below the current one (i find that more intuitive) | 287 | set splitbelow | " open new windows below the current one (i find that more intuitive) |
277 | set shiftround | " indent/unindent snaps to multiple of shiftwidth | 288 | set shiftround | " indent/unindent snaps to multiple of shiftwidth |
278 | set showcmd | " essential: show keys of combined commands in the lower right corner | 289 | set showcmd | " essential: show keys of combined commands in the lower right corner |
290 | set tags+=../tags | ||
279 | set t_Co=256 | " required on some ssh sessions | 291 | set 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...) |
281 | set textwidth=120 | " @IPQ | 293 | set textwidth=120 | " better done with modeline |
282 | set colorcolumn=120 | " @IPQ | 294 | set colorcolumn=120 | " better done with modeline |
283 | set thesaurus+=/home/max/.vim/thesaurus/php.txt | 295 | set thesaurus+=/home/max/.vim/thesaurus/php.txt |
284 | set ts=4 sts=4 sw=4 expandtab | " @IPQ | 296 | set ts=4 sts=4 sw=4 expandtab | " better done with a modeline |
285 | set ttimeoutlen=50 | " set esc key timeout in ms- | 297 | set ttimeoutlen=10 | " set esc key timeout in ms- |
286 | set updatetime=1000 | " updates the screen more often | 298 | set updatetime=1000 | " updates the screen more often |
287 | set writedelay=0 | 299 | set 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. |