From b5d62fe0b70be517c4a8e12483df194c91933154 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sat, 6 May 2017 16:23:11 +0200 Subject: Performance improvements + code refactoring --- vimrc | 534 +++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 270 insertions(+), 264 deletions(-) diff --git a/vimrc b/vimrc index cca37a8..e18b9f5 100644 --- a/vimrc +++ b/vimrc @@ -1,84 +1,70 @@ -" vim: textwidth=160 tabstop=2 shiftwidth=2 -" -if has('nvim') - runtime! python_setup.vim -endif +" vim: textwidth=160 tabstop=2 shiftwidth=2 tw=160 colorcolumn=160 +" START: LOADING PLUGINS +" ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ call plug#begin() +Plug 'tpope/vim-surround' | " plugin makes cs"' inside a line replace " with ' +Plug 'tpope/vim-fugitive' | " the most complete GIT integration plugin +Plug 'godlygeek/tabular' | " align code on a sign, like :Tab/= +Plug 'ryanoasis/vim-devicons' | " eye candy icons +Plug 'mhinz/vim-signify' | " uses the sign column to indicate added, modified and removed lines -" Brilliant_Plugins_by_tpope: ========================. -" Plug 'tpope/vim-sensible' | " a sane and modern default configuration # not required with nvim -Plug 'tpope/vim-surround' | " plugin makes cs"' inside a line replace " with ' -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' -Plug 'airblade/vim-rooter' | " makes :lcd changes to projects (git-)root (code-completion, gf, grep, find) +" TESTING: | " plugins which I am currently trying... +" Plug 'rkitover/vimpager' +" Plug 'wting/gitsessions.vim' | " worth a try: restore sessions based on the git repo you are working in +" Plug 'Shougo/neocomplete.vim' | " alternative to YouCompleteMe in some cases +" Plug 'tpope/vim-characterize' | " normal mode: make ga show character names of Unicode chars (ga shows hex and dec values) -nnoremap :ToggleBufExplorer +" Colorschemes: +Plug 'chriskempson/base16-vim' | " not just one high quality color scheme (all named base16-*) + +" SCRATCH: | " Unobtrusive scratch window +Plug 'mtth/scratch.vim' nnoremap :ScratchPreview -nnoremap :syntax sync fromstart:nohlsearch +" VIM_ROOTER: | " Unobtrusive scratch window +Plug 'airblade/vim-rooter' | " makes :lcd changes to projects (git-)root (code-completion, gf, grep, find) + +" BUFEXPLORER: | " a buffer to list all buffers has the advantage, that default /-searches work in there +Plug 'jlanzarotta/bufexplorer' +nnoremap :ToggleBufExplorer +" autocmd BufEnter * lcd %:p:h | " Plugin vim-rooter get used instead (which is much more sane as well) -" AIRLINE: ===========================================. +" AIRLINE: a fancy status line ========================================================================================= Plug 'vim-airline/vim-airline' | " beautification of the mode line set laststatus=2 | " required by AirLine, without status line does not appear until a window split -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', 'tagbar'] -let g:airline#extensions#tabline#disable_refresh = 1 | -let g:airline#extensions#tabline#enabled = 1 | +let g:airline_extensions = ['tabline', 'branch', 'syntastic', 'tagbar', 'whitespace', 'ycm'] +let b:airline_whitespace_checks = ['indent', 'trailing', 'long', 'mixed-indent-file'] +let g:airline_section_c = "" | " was: %F +let g:airline#extensions#tagbar#flags = 'f' | " even though the airline extension is off this controls :h tagbar-extend +let g:airline#extensions#tabline#left_sep = ' ' +let g:airline#extensions#tabline#left_alt_sep = ' | ' 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 = 0 | -let g:airline#extensions#tagbar#flags = 's' -let g:airline#extensions#tagbar#currenttag = 'f' -let g:airline#extensions#whitespace#enabled = 0 | -let g:airline#extensions#wordcount#enabled = 0 | -let g:airline_inactive_collapse = 1 | -let g:airline_powerline_fonts = 1 | -let g:airline_section_c = '%F' - - -" AIRLINE_Theme: =====================================. -Plug 'vim-airline/vim-airline-themes' | " airline themes to match any light and dark terminal using :AirlineTheme -let g:airline_theme='base16' | " specifies which colorscheme should airline uses -" let g:airline_theme='badcat' | " specifies which colorscheme should airline uses -" let g:airline_theme='papercolor' | " specifies which colorscheme should airline uses - - -" Colorschemes: ======================================. -Plug 'ryanoasis/vim-devicons' | " eye candy icons -Plug 'chriskempson/base16-vim' | " -map q :bpspbnbd. - - -" NETRW: =============================================. -let g:netrw_list_hide = '^\..*' | " Explore mode: hide files starting with dot -let g:netrw_hide = 1 | " show not-hidden files only -let g:netrw_liststyle = 3 | " 3=tree -let g:netrw_banner = 0 | " display help messages? -let g:netrw_winsize = 20 | " window size in percent -let g:netrw_fastbrowse = 2 | " manually refresh direcory list (avoids display errors) -let g:netrw_keepdir = 0 -let g:netrw_browse_split = 4 | " 4=open in previous window -let g:netrw_preview = 0 | " -let g:netrw_alto = 0 | " open files on the right -let g:netrw_altv = 1 | " open files on the right - -" 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 g:airline#extensions#tabline#disable_refresh = 1 | +let g:airline#extensions#tabline#enabled = 1 | +let g:airline#extensions#tabline#show_buffers = 1 | +let g:airline#extensions#tabline#show_tabs = 0 | +let g:airline#extensions#tagbar#enabled = 0 | +let g:airline#extensions#whitespace#enabled = 1 | +let g:airline#extensions#wordcount#enabled = 0 | +let g:airline_detect_modified = 0 | +let g:airline_detect_paste = 0 | +let g:airline_exclude_preview = 0 | +let g:airline_inactive_collapse = 1 | +let g:airline_powerline_fonts = 1 | +" AIRLINE_Theme: +Plug 'vim-airline/vim-airline-themes' | " airline themes to match any light and dark terminal using :AirlineTheme +let g:airline_theme='base16' | " specifies which colorscheme should airline uses +" let g:airline_theme='badcat' | " specifies which colorscheme should airline uses +" let g:airline_theme='papercolor' | " specifies which colorscheme should ionirline uses + + +" NERDTree: replaces NetRW, as long as it has so many bugs +Plug 'scrooloose/nerdtree' | " +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) " depending on if NERDTree has the focus: nnoremap @@ -123,71 +109,71 @@ nnoremap :TagbarToggle| " bind TagBar to Hotkey Ct " Autocompleter: =====================================. -Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... +Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... Plug 'Valloric/YouCompleteMe' -let g:ycm_add_preview_to_completeopt = 1 " reuse existing preview window +let g:ycm_add_preview_to_completeopt = 1 " reuse existing preview window let g:ycm_autoclose_preview_window_after_insertion = 1 -let g:ycm_collect_identifiers_from_tags_files = 1 " Let YCM read tags from Ctags file -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_use_ultisnips_completer = 1 " Default 1, just ensure -let g:ycm_warning_symbol = '➔' " insert this as a warning symbol in the gutter bar -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' -let g:ycm_semantic_triggers = { 'c': [ 're!.' ] } -" 'cmake -D CMAKE_EXPORT_COMPILE_COMMANDS=1 ..' can be used to generate a .ycm-extra.conf compatible json file +let g:ycm_collect_identifiers_from_tags_files = 1 " Let YCM read tags from Ctags file +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_use_ultisnips_completer = 1 " Default 1, just ensure +let g:ycm_warning_symbol = '➔' " insert this as a warning symbol in the gutter bar +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' +let g:ycm_semantic_triggers = { 'c': [ 're!.' ] } " 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' " you better use cmake to generate json build commands, like: +" 'cmake -D CMAKE_EXPORT_COMPILE_COMMANDS=1 ..' can be used to generate a .ycm-extra.conf compatible json file -" Plug 'ervandew/supertab' Plug 'scrooloose/syntastic' set statusline+=%#warningmsg# set statusline+=%{SyntasticStatuslineFlag()} -set statusline+=%* -" set signcolumn=yes " always show the column +" 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 let g:syntastic_auto_loc_list = 0 let g:syntastic_check_on_open = 1 let g:syntastic_check_on_wq = 0 -let g:syntastic_quiet_messages = {"type":"style"} " filter ( = do not display) style/formatting errors and warnings -" Syntastic +let g:syntastic_quiet_messages = {"type":"style"} +" filter ( = do not display) style/formatting errors and warnings let g:syntastic_error_symbol = '✖' let g:syntastic_style_error_symbol = '✗' let g:syntastic_warning_symbol = '➔' let g:syntastic_style_warning_symbol = '≈' -Plug 'davidhalter/jedi-vim' " jedi gets used to display python function signatures -let g:jedi#completions_enabled = 0 " we do not need completions, because we have YouCompleteMe -let g:jedi#show_call_signatures = 1 " which sadly does not support signatures like jedi +Plug 'davidhalter/jedi-vim' " jedi gets used to display python function signatures +let g:jedi#completions_enabled = 0 " we do not need completions, because we have YouCompleteMe +let g:jedi#show_call_signatures = 1 " which sadly does not support signatures like jedi let g:jedi#show_call_signatures_delay = 0 let g:jedi#auto_vim_configure = 0 -let g:pymode_rope = 0 " https://github.com/davidhalter/jedi-vim/issues/163 +let g:pymode_rope = 0 " https://github.com/davidhalter/jedi-vim/issues/163 " autocmd FileType python jedi.preload_module('os', 'sys', 'math') " let g:pymode_options_max_line_length = 120 " let g:syntastic_python_flake8_args='--ignore=F821,E302,E501,E241,E301' -Plug 'honza/vim-snippets' " dependency of ultisnips (see below) -Plug 'SirVer/ultisnips' " replaces loremipsum (and many more) +" ULTISNIPS: code snippet ============================================================================================== +Plug 'honza/vim-snippets' " dependency of ultisnips (see below) +Plug 'SirVer/ultisnips' " replaces loremipsum (and many more) "let g:UltiSnipsExpandTrigger = ''| " Trigger configuration. Do not use if you use https://github.com/Valloric/YouCompleteMe. "let g:UltiSnipsJumpForwardTrigger = ''| " \ "let g:UltiSnipsJumpBackwardTrigger = ''| " \ -"let g:UltiSnipsListSnippets = ''| " YouCompleteMe includes those, so this isn't necessary -" let g:UltiSnipsExpandTrigger = ''| " Trigger configuration. Do not use if you use https://github.com/Valloric/YouCompleteMe. -" let g:UltiSnipsJumpForwardTrigger = ''| " \ -" let g:UltiSnipsJumpBackwardTrigger = ''| " \ -" let g:UltiSnipsListSnippets = ''| " YouCompleteMe includes those, so this isn't necessary - +"let g:UltiSnipsListSnippets = ''| " YouCompleteMe includes those, so this isn't necessary +"let g:UltiSnipsExpandTrigger = ''| " Trigger configuration. Do not use if you use https://github.com/Valloric/YouCompleteMe. +"let g:UltiSnipsJumpForwardTrigger = ''| " \ +"let g:UltiSnipsJumpBackwardTrigger = ''| " \ +"let g:UltiSnipsListSnippets = ''| " YouCompleteMe includes those, so this isn't necessary " UltiSnips triggering " let g:UltiSnipsExpandTrigger = "" " let g:ulti_expand_or_jump_res = 0 @@ -201,63 +187,42 @@ Plug 'SirVer/ultisnips' " replaces loremipsum (and " endfunction " inoremap pumvisible() ? "\=ExpandSnippetOrCarriageReturn()\" : "\" " set completeopt-=preview - " let g:UltiSnipsEditSplit = 'vertical' -" Disabled ===========================================. -" Plug 'Shougo/neocomplete.vim' | " alternative to YouCompleteMe in some cases -" Plug 'tpope/vim-characterize' | " normal mode: make ga show character names of Unicode chars (ga shows hex and dec values) -" Plug 'tpope/vim-repeat' | " lets . (dot) repeat plugin macros as well, specifically vim-surround - call plug#end() | " all plugins are getting loaded on this line, don't remove! +" ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ +" END: LOADING PLUGINS + +"======================================================================================================================= +" GENERAL: +"======================================================================================================================= filetype on filetype plugin on filetype indent on + 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 - - - -" Shortcut mods =======================================. -inoremap -"inoremap -vnoremap < >gv| " allows indenting a selected block and keeps selection - - -" Bind CTRL+Backspace to vims version (CTRL+W) in " insert mode (only works with gvim) -inoremap - \ - \ - -noremap :make - -" default copy&paste insert key binding (just in insert mode, so it doesn't conflict -" with visual block mode). -inoremap + -inoremap :w - - +"======================================================================================================================= +" SPELL_CHECKING: +"======================================================================================================================= +set spell | " enable spell checker +set spelllang=en,de | " languages for the spell checker +set spellsuggest=10 | " how many words will z= suggest? +set thesaurus+=/home/max/.vim/thesaurus/php.txt +let g:spellfile_URL='http://ftp.vim.org/vim/runtime/spell' -" spell checkers? -set spell spelllang=en,de | " enable spell checker set dictionary=/usr/share/dict/cracklib-small set complete+=k " make default completer respect the dictionary -let g:spellfile_URL = 'http://ftp.vim.org/vim/runtime/spell' - -" settings ============================================. -" -" autocmd BufEnter * lcd %:p:h -" set autochdir | " When on, Vim will change the current working directory +"======================================================================================================================= +" SETTINGS: +"======================================================================================================================= +set noautochdir | " When on, Vim will change the current working directory set shell=/bin/bash | " many scripts rely on bash, but its path varies why it is commented out here -" set selectmode=mouse,key,cmd | " enters vim's select mode when pressing shift-left or shift-END -" set keymodel=startsel,stopsel | " makes shift-left, shift-right available for selecting text set breakindent | " Every wrapped line will continue visually indented set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well) set cmdheight=2 | " sets the command line's height @@ -293,53 +258,71 @@ set redrawtime=400 | " The time in milliseconds for redrawing the dis set scrolljump=5 | " how many lines get scrolled into view when cursor reaches the screens edge 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 showcmd | " essential: show keys of combined commands in the lower right corner (BUT SLOW, makes cursor flickering) +set noshowcmd | " essential: show keys of combined commands in the lower right corner (BUT SLOW, makes cursor flickering) +set winwidth=30 | " keep NERDTreeWindow at least this size +set winminwidth=30 | " (and all other windows, so TODO: watch out) 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 | " better done with modeline +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 | " 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 set lcs+=space:· | " local space char +"======================================================================================================================= +" COLORSCHEME: +" set term=xtermc | " may be required on solaris +set t_Co=256 | " required on some ssh sessions +let &t_Co=256 +set background=light | " hint how the terminal background looks like -if has("multi_byte") - scriptencoding utf-8 | " tell vim that we are using utf-8 here - set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below) - set termencoding=&encoding | " once we use special chars we assume everybody uses a terminal supporting those - - set listchars= | " initialize empty listchars - set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars) - 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+=eol:↲ | " 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 - set list -end +" set termguicolors +let base16colorspace=256 +if filereadable(expand("~/.vimrc_background")) + source ~/.vimrc_background +else + colorscheme base16-phd +" colorscheme base16-embers +" colorscheme base16-flat +" colorscheme base16-summerfruit-dark +" colorscheme base16-tommorow +" colorscheme base16-default-dark +endif -if has("gui_running") - set toolbar+=text - set guioptions+=eig - set guioptions-=T | " toolbar - set guioptions+=c | " use console dialogs instead of popups - set guioptions+=a | " autoselect: copy&paste using middleclick - set guioptions-=m | " remove menu - " set guifont=Droid\ Sans\ Mono\ for\ Powerline\ 12 - set guifont=Dejavu\ Sans\ Mono\ for\ Powerline\ 12 - set guioptions-=e | " do not display tabs - set guioptions-=L | " do not show left scrollbar - set guioptions-=r | " do not show right scrollbar - set winaltkeys=menu | " behave like other windows: ALT-key can be used to open the menu (and cannot be :remaped) +highlight normal ctermbg=NONE | " uses the default terminal background color as background (allows transparency) +highlight CursorLineNr ctermbg=black ctermfg=NONE + + +highlight Cursor guibg=green +" let &t_EI .= "\[0 q" +" let &t_SI = "\]12;green\x7" +if has('autocmd') + autocmd VimEnter * let &t_EI .= "\[0 q" + autocmd VimEnter * let &t_SI = "\]12;black\x7" + autocmd VimLeave * silent !echo -ne "\033]112\007" endif +"======================================================================================================================= +if has("multi_byte") + scriptencoding utf-8 | " tell vim that we are using utf-8 here + set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below) + set termencoding=&encoding | " once we use special chars we assume everybody uses a terminal supporting those + + set listchars= | " initialize empty listchars + set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars) + 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+=eol:↲ | " 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 + set list +end -if has('cscope') +if has('cscope') " compiled with cscope support? " http://vim.wikia.com/wiki/Cscope set cscopetag cscopeverbose @@ -354,15 +337,34 @@ if has('cscope') cnoreabbrev css cs show cnoreabbrev csh cs help - command -nargs=0 Cscope cs add $VIMSRC/src/cscope.out $VIMSRC/src -endif - + command! -nargs=0 Cscope cs add $VIMSRC/src/cscope.out $VIMSRC/src +endif -if bufname('%') == '' - set bufhidden=wipe +" GUI_VERSION: +if has("gui_running") + set toolbar+=text + set guioptions+=eig + set guioptions-=T | " toolbar + set guioptions+=c | " use console dialogs instead of popups + set guioptions+=a | " autoselect: copy&paste using middleclick + set guioptions-=m | " remove menu + set guioptions-=e | " do not display tabs + set guioptions-=L | " do not show left scrollbar + set guioptions-=r | " do not show right scrollbar + set winaltkeys=menu | " behave like other windows: ALT-key can be used to open the menu (and cannot be :remaped) + set guifont=Dejavu\ Sans\ Mono\ for\ Powerline\ 12 + " set guifont=Droid\ Sans\ Mono\ for\ Powerline\ 12 +" set selectmode=mouse,key,cmd | " enters vim's select mode when pressing shift-left or shift-END +" set keymodel=startsel,stopsel | " makes shift-left, shift-right available for selecting text endif -" noautocmd +" NEOVIM_incompatible: +if !has('nvim') | " settings which have been removed from neovim + set ttymouse=xterm2 + set ttyscroll=100 | " improves speed for terminal vim, incomp. with nvim + set ttyfast | " improves speed for terminal vim (incomp. with nvim) + " set termguicolors | " When on, uses highlight-guifg and highlight-guibg attributes in the terminal (=24bit color) incomp. with nvim +endif if has("autocmd") set modeline | " set variables specific to a file, like indentation by adding a comment @@ -370,15 +372,14 @@ if has("autocmd") set omnifunc=syntaxcomplete#Complete " automatically reload this file when it gets edited - augroup reload_vimrc " { - autocmd! - autocmd BufWritePost $MYVIMRC source $MYVIMRC - augroup END " } - - augroup extra_whitespace " { - highlight ExtraWhitespace ctermbg=red guibg=red - syn match ExtraWhitespace /\s\+$/ - augroup END "} + if !exists("*OnConfigChange") + function OnConfigChange() + autocmd! |" Remove all vimrc autocommands + source $MYVIMRC + AirlineRefresh + endfunction + autocmd BufWritePost $MYVIMRC call OnConfigChange() + endif augroup set_window_title " { " autocmd BufWinEnter quickfix setl statusline=%t @@ -398,21 +399,6 @@ if has("autocmd") endif augroup END - augroup visual_mode_shows_unprintable " { - " set cursorline | " use setcursorline in order to highlight non printable chars in the current line - 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. - " highlight ColorColumn guibg=#005f87 - " highlight ColorColumn guibg=#F0F0E0 - augroup END " } - - " hitting K over a keyword shows a help in a buffer. " Here we define the commands used to look those keywords up " as per file type... @@ -439,11 +425,6 @@ if has("autocmd") augroup END - augroup ChangeCursor - autocmd VimEnter * let &t_EI .= "\[0 q" - autocmd VimEnter * let &t_SI = "\]12;yellow\x7" - autocmd VimLeave * silent !echo -ne "\033]112\007" - augroup END augroup ChangeIcon "if filereadable("/usr/bin/xseticon") @@ -491,63 +472,96 @@ if has("autocmd") nmap