From 06499260aeac6e84f0674e3d780a7ad84938841e Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Tue, 28 Mar 2017 17:19:47 +0200 Subject: use f-keys to toggle some default windows --- vimrc | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 53 insertions(+), 11 deletions(-) (limited to 'vimrc') 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 Plug 'tpope/vim-fugitive' | " the most complete GIT integration plugin Plug 'godlygeek/tabular' | " align code on a sign, like :Tab/= Plug 'mhinz/vim-signify' | " show changes in the clutter bar +Plug 'jlanzarotta/bufexplorer' +" Plug 'wting/gitsessions.vim' +Plug 'rkitover/vimpager' +Plug 'mtth/scratch.vim' + +nnoremap :ToggleBufExplorer +nnoremap :ScratchPreview +nnoremap :syntax sync fromstart|:nohlsearch " AIRLINE: ===========================================. @@ -65,6 +73,7 @@ let g:netrw_altv = 1 | " open files on the righ " NERDTree: ==========================================. Plug 'scrooloose/nerdtree' | " replace NetRW, which is kind of buggy let NERDTreeCascadeSingleChildDir = 0 | " I don't get how one can use to create files in that included directory +let NERDTreeShowBookmarks = 1 | " show bookmarks by default (when opening for the first time) let NERDTreeIgnore = ['\.aux$'] set winwidth=30 " keep NERDTreeWindow at least this size set winminwidth=30 " (and all other windows, so TODO: watch out) @@ -108,6 +117,7 @@ let g:tagbar_compact = 0 let g:tagbar_indent = 0 let g:tagbar_foldlevel = 99 nnoremap l :TagbarToggle| " bind TagBar to Hotkey Ctrl+L +nnoremap :TagbarToggle| " bind TagBar to Hotkey Ctrl+L " Autocompleter: =====================================. @@ -124,10 +134,11 @@ let g:ycm_warning_symbol = '➔' " insert this as a warni let g:ycm_confirm_extra_conf = 0 " security is overrated let g:ycm_key_list_select_completion = [''] let g:ycm_key_list_previous_completion = [''] +let g:ycm_global_ycm_extra_conf = '~/src/.ycm_extra_conf.py' " disable -key for YCM so that it can be used with ultisnips " let g:ycm_key_list_select_completion=[] " let g:ycm_key_list_previous_completion=[] -Plug 'rdnetto/YCM-Generator' +" Plug 'rdnetto/YCM-Generator' " Plug 'ervandew/supertab' @@ -276,13 +287,14 @@ set scrolljump=5 | " how many lines get scrolled into view when cur set splitbelow | " open new windows below the current one (i find that more intuitive) set shiftround | " indent/unindent snaps to multiple of shiftwidth set showcmd | " essential: show keys of combined commands in the lower right corner +set tags+=../tags set t_Co=256 | " required on some ssh sessions " set textwidth=100 | " line length (80 used to be default, but...) -set textwidth=120 | " @IPQ -set colorcolumn=120 | " @IPQ +set textwidth=120 | " better done with modeline +set colorcolumn=120 | " better done with modeline set thesaurus+=/home/max/.vim/thesaurus/php.txt -set ts=4 sts=4 sw=4 expandtab | " @IPQ -set ttimeoutlen=50 | " set esc key timeout in ms- +set ts=4 sts=4 sw=4 expandtab | " better done with a modeline +set ttimeoutlen=10 | " set esc key timeout in ms- set updatetime=1000 | " updates the screen more often set writedelay=0 @@ -331,10 +343,10 @@ if has("autocmd") autocmd BufWritePost $MYVIMRC source $MYVIMRC augroup END " } - augroup remove_whitespaces " { - " automatically remove trailing white spaces on save.. - autocmd BufWritePre * %s/\s\+$//e - augroup END " } + " augroup remove_whitespaces " { + " " automatically remove trailing white spaces on save.. + " autocmd BufWritePre * %s/\s\+$//e + " augroup END " } augroup set_window_title " { " autocmd BufWinEnter quickfix setl statusline=%t @@ -404,8 +416,8 @@ if has("autocmd") augroup ChangeIcon "if filereadable("/usr/bin/xseticon") "if filereadable("~/.vim/nvim.png") - autocmd VimEnter * silent :execute "!xseticon -id $WINDOWID ~/.vim/nvim.png" - autocmd VimLeave * silent :execute "!xseticon -id $WINDOWID /usr/share/icons/gnome/32x32/apps/xfce-terminal.png" + " autocmd VimEnter * silent :execute "!xseticon -id $WINDOWID ~/.vim/nvim.png" + " autocmd VimLeave * silent :execute "!xseticon -id $WINDOWID /usr/share/icons/gnome/32x32/apps/xfce-terminal.png" "endif "endif augroup END @@ -417,6 +429,36 @@ if has("autocmd") autocmd VimLeave * call system("echo -n $'" . escape(getreg(), "'") . "' | xsel -ib") augroup END endif + + + augroup ToggleQuickFix + function! ToggleQuickFix() + if exists("g:qwindow") + lclose + unlet g:qwindow + else + try + lopen 10 + let g:qwindow = 1 + catch + echo "No Errors found!" + endtry + endif + endfunction + function! QFixToggle(forced) + if exists("g:qfix_win") && a:forced == 0 + cclose + unlet g:qfix_win + else + copen 10 + let g:qfix_win = bufnr("$") + endif + endfunction + + nmap