From 73c1b25d759b3881e8f317e395c9a168a2c3ad3d Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Wed, 26 Oct 2016 01:57:52 +0200 Subject: Optimized for termite terminal --- vimrc | 69 +++++++++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 27 deletions(-) (limited to 'vimrc') diff --git a/vimrc b/vimrc index a6d90a1..c98cac6 100644 --- a/vimrc +++ b/vimrc @@ -14,13 +14,15 @@ map q :bpspbnbd. " 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 set winwidth=30 " keep NERDTreeWindow at least this size set winminwidth=30 " (and all other windows, so TODO: watch out) +autocmd BufEnter * lcd %:p:h " depending on if NERDTree has the focus: nnoremap \ - \ bufwinnr("%")==g:NERDTree.GetWinNum() ? ':NERDTreeClose' : ':NERDTreeCWD' + \ bufwinnr("%")==g:NERDTree.GetWinNum() ? ':NERDTreeClose' : ':NERDTreeFind' nnoremap \ \ bufwinnr("%")==g:NERDTree.GetWinNum() ? '' : ':bn' @@ -28,8 +30,8 @@ nnoremap \ \ bufwinnr("%")==g:NERDTree.GetWinNum() ? '' : ':bp' " close NERDTree if it is the last remaining window (taken from the official documentation) -autocmd bufenter * - \ if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif +" autocmd bufenter * +" \ if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif " AIRLINE: ===========================================. @@ -38,13 +40,13 @@ set laststatus=2 | " required by AirLine, w let g:airline_detect_modified = 0 | let g:airline_detect_paste = 0 | let g:airline_exclude_preview = 1 | -let g:airline_extensions = ['tabline', 'branch', 'syntastic'] +let g:airline_extensions = ['tabline', 'branch', 'syntastic', 'tagbar'] let g:airline#extensions#tabline#disable_refresh = 1 | let g:airline#extensions#tabline#enabled = 1 | let g:airline#extensions#tabline#fnamemod = ':t:.' | " let airline just show the filename without its path let g:airline#extensions#tabline#show_buffers = 1 | let g:airline#extensions#tabline#show_tabs = 0 | -let g:airline#extensions#tagbar#enabled = 1 | +let g:airline#extensions#tagbar#enabled = 0 | let g:airline#extensions#tagbar#flags = 's' let g:airline#extensions#whitespace#enabled = 0 | let g:airline#extensions#wordcount#enabled = 0 | @@ -64,26 +66,32 @@ Plug 'sheerun/vim-polyglot' " better syntax highlighti Plug 'majutsushi/tagbar' " superseeds taglist-plus, which isn't maintained any more let g:tagbar_autoclose = 1 let g:tagbar_autofocus = 1 -let g:tagbar_compact = 1 +let g:tagbar_autoshowtag = 1 +let g:tagbar_compact = 0 let g:tagbar_indent = 0 +let g:tagbar_foldlevel = 99 nnoremap l :TagbarToggle| " bind TagBar to Hotkey Ctrl+L " Autocompleter: =====================================. Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... Plug 'Valloric/YouCompleteMe' -let g:ycm_error_symbol = '✖' " insert this as an error symbol in the gutter bar -let g:ycm_warning_symbol = '➔' " insert this as a warning symbol in the gutter bar let g:ycm_collect_identifiers_from_tags_files = 1 " Let YCM read tags from Ctags file -let g:ycm_use_ultisnips_completer = 1 " Default 1, just ensure -let g:ycm_seed_identifiers_with_syntax = 1 " Completion for programming language's keyword let g:ycm_complete_in_comments = 1 " Completion in comments let g:ycm_complete_in_strings = 1 " Completion in string +let g:ycm_error_symbol = '✖' " insert this as an error symbol in the gutter bar +let g:ycm_min_num_of_chars_for_completion = 1 +let g:ycm_seed_identifiers_with_syntax = 1 " Completion for programming language's keyword +let g:ycm_use_ultisnips_completer = 1 " Default 1, just ensure +let g:ycm_warning_symbol = '➔' " insert this as a warning symbol in the gutter bar + + Plug 'scrooloose/syntastic' set statusline+=%#warningmsg# set statusline+=%{SyntasticStatuslineFlag()} set statusline+=%* +set signcolumn=yes " always show the column let g:LatexBox_latexmk_preview_continuously = 1 let g:LatexBox_viewer = "evince" let g:syntastic_always_populate_loc_list = 1 @@ -130,18 +138,6 @@ syntax on | " enable syntax highlighting syntax sync minlines=60 | " how many preceding lines will be parsed? (has performance impact) " set term=xtermc | " required on solaris -let base16colorspace=256 -colorscheme base16-phd -" colorscheme base16-embers -" colorscheme base16-flat -" colorscheme base16-summerfruit-dark -" colorscheme base16-tommorow -" colorscheme base16-default-dark - - -" colorscheme customizations ========================= -" override colorscheme's background color in order to honor the terminals background transparency -hi normal ctermbg=none " Shortcut mods =======================================. @@ -195,6 +191,7 @@ set thesaurus+=/home/max/.vim/thesaurus/php.txt set ts=2 sts=2 sw=2 expandtab | " indentation which i like (abbr: tabstop, softtabstop, shiftwidth) set ttimeoutlen=10 | " set esc key timeout in ms- set ttyfast | " improves speed for terminal vim +set updatetime=1000 | " updates the screen more often set ttyscroll=100 | " improves speed for terminal vim set writedelay=0 " set termguicolors | " When on, uses highlight-guifg and highlight-guibg attributes in the terminal (=24bit color) @@ -207,6 +204,7 @@ if has("multi_byte") set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars) set listchars+=tab:▸\ | " symbols used when using :set list (which displays non-printable chars) set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars) + set listchars+=space:· | " symbols used when using :set list (which displays non-printable chars) set showbreak+=› | " symbol used in the beginning of a wrapped line end @@ -247,8 +245,9 @@ if has("autocmd") augroup set_window_title " { " autocmd BufWinEnter quickfix setl statusline=%t " autocmd BufEnter * let &titlestring = hostname() . "[vim(" . expand("%:t") . ")]" - autocmd BufEnter * let &titlestring = "%t|".$USER."@".hostname().":%{expand(\"%:~:.:h\")}%=%y" - + autocmd CursorHold * let &titlestring = "%t|".$USER."@".hostname().":%{expand(\"%:~:.:h\")}%=%y" + set title + " autocmd CursorHold * let &titlestring = "Vim (".airline#extensions#tagbar#currenttag().")" " set window title for screen(3) if &term == "screen" @@ -262,10 +261,12 @@ if has("autocmd") augroup END augroup visual_mode_shows_unprintable " { - set nolist | " shows unprinable characters in the current line " set cursorline | " use setcursorline in order to highlight non printable chars in the current line - autocmd ColorScheme * highlight NonText ctermbg=0 gui=bold guifg=#061229 - autocmd ColorScheme * highlight CursorLineNr term=bold ctermfg=Yellow gui=bold guifg=Yellow + autocmd ColorScheme * highlight normal ctermbg=NONE + " set list | " shows unprinable characters in the current line + autocmd ColorScheme * highlight NonText ctermbg=NONE ctermfg=0 gui=bold guifg=NONE + autocmd ColorScheme * highlight SpecialKey ctermbg=NONE ctermfg=0 gui=bold guifg=NONE + " autocmd ColorScheme * highlight CursorLineNr term=bold ctermbg=NONE ctermfg=0 gui=bold guifg=Yellow " " " highlight NonText guifg=#1d1f21 | " make non printable chars invisible. The active line is an exception. @@ -301,6 +302,20 @@ if has("autocmd") endif +let base16colorspace=256 +colorscheme base16-phd +" colorscheme base16-embers +" colorscheme base16-flat +" colorscheme base16-summerfruit-dark +" colorscheme base16-tommorow +" colorscheme base16-default-dark + + +" colorscheme customizations ========================= +" override colorscheme's background color in order to honor the terminals background transparency + + + " if filereadable(expand("~/.vimrc_background")) " let base16colorspace=256 " source ~/.vimrc_background -- cgit v1.2.3