From f06d6454cae2b379b6938eba671273a201c1f0e2 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sat, 13 May 2017 15:08:45 +0200 Subject: Restructured and improved register macros --- vimrc-full | 158 ++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 82 insertions(+), 76 deletions(-) diff --git a/vimrc-full b/vimrc-full index ce8b007..47bcc5e 100644 --- a/vimrc-full +++ b/vimrc-full @@ -2,11 +2,76 @@ set encoding=utf-8 | " set up vim's cosole encoding (not file encoding, for which there is fileencoding=) set t_Co=256 | " required on some ssh sessions -" set background=light | " +" set background=light | " " set term=xtermc | " may be required on solaris " set term=xterm-256color " set termguicolors +"======================================================================================================================= +" MATTER_OF_TASTE: +"======================================================================================================================= +set textwidth=120 | " better done with modeline +set ts=4 sts=4 sw=4 expandtab | " better done with a modeline + +"======================================================================================================================= +" SETTINGS: +"======================================================================================================================= +set noautochdir | " When on, Vim will change the current working directory +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 +set complete+=d | " scan current and included files for defined name or macro +set complete+=i | " scan current and included files for completions +set concealcursor=nc | " limits the display of concealed text to normal and command mode +set conceallevel=2 | " replace escaped chars by their utf-8 representation (useful for LaTeX) +set confirm | " asks 'do you want to save?' +set cpoptions+=P | " makes :w filename set the current buffer to filename +set hidden | " allows switiching buffers even if the current buffer contains changes (displays +) +set hlsearch | " highlights all search matches (not as performant!) +set ignorecase smartcase | " search with ignorecase by default, but use case sensitive search when one captical char is contained +set lazyredraw | " disables redraw during macro exectution (improves performance) +set linebreak | " wrap long lines at char 'breakat', not inside words +set mouse=n | " allow mouse in normal mode only, so one can use the terminals c&p feature in insert mode +set mousemodel=popup | " only in gvim: right click opens a popup-menu +set nocursorcolumn | " turn visual cursor column off (improves performance) +set nocursorline | " turn visual cursor line off (improves performance) +set nrformats+=alpha | " allows CTRL-A & CTRL-X to increment and decrement letters, not just numbers +set nofoldenable | " disable code folding. I hate code folding +set foldmethod=syntax | " foldlevel: syntax, indent, manual +set foldcolumn=1 | " if code folding gets used display it in the clutter bar, where line numbers live +set foldclose=all | " automatically fold, when the cursor leaves the folded area +set foldopen=all | " unfold when cursor moves into the closed fold +set foldtext=Foldtext() | " +set foldnestmax=1 | " top level folding only +set relativenumber | " relative line numbers can speed up navigation +set noshowmode | " because we are using some powerline derivat +set nostartofline | " when scrolling: do not move the cursor to column 1 +set notimeout ttimeout | " improves performance but is known to cause problems on slow terminals +set ttimeoutlen=50 | " set esc key timeout in ms- +set nowrap | " but do not (by default) wrap long lines around +set number | " turn line numbers on/off (performance decreases when they are shown) +set pumheight=8 | " Determines the maximum number of items to show in the popup menu for +set path+=** | " allow recursive searches for files +set redrawtime=400 | " The time in milliseconds for redrawing the display. +" set restorescreen | " restores the console after exiting vim +" set shada+=n~/.vim/shada | " shada file to use +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 (BUT SLOW, makes cursor flickering) +set showtabline=2 | " 0: never, 1: only if there are at least two tabs, 2:always +set winwidth=30 | " keep NERDTreeWindow at least this size +set winminwidth=30 | " (and all other windows, so TODO: watch out) +set tags+=../tags +" set textwidth=100 | " line length (80 used to be default, but...) +" set colorcolumn= | " not used, because we have a :match directive for textwidth +set updatetime=1000 | " updates the screen more often +set writedelay=0 +set wildmenu | " use a menu in the command line +set wildmode=longest:full | " do not preselect any entry and show all possible +"======================================================================================================================= + + " START: LOADING PLUGINS " ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ call plug#begin() @@ -18,7 +83,6 @@ Plug 'godlygeek/tabular' | " align code on a sign, like :Tab/= " 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) @@ -89,9 +153,10 @@ nnoremap :TagbarToggle| " bind TagBar to Hotkey Ct " 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 set background=light + +Plug 'vim-airline/vim-airline' | " beautification of the mode line let g:airline_extensions = ['tabline', 'branch', 'syntastic', 'whitespace', 'ycm'] let b:airline_whitespace_checks = ['indent', 'trailing', 'long', 'mixed-indent-file'] let g:airline_section_c = "" | " was: %F @@ -128,10 +193,7 @@ let g:airline#themes#base16#constant = 0 " let g:airline_theme='badcat' | " specifies which colorscheme should airline uses " let g:airline_theme='papercolor' | " specifies which colorscheme should ionirline uses -" Autocompleter: =====================================. -" -" - +" Autocompleter: ===================================== if has("python") " YouCompleteMe: ===================================================================================================== " Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... @@ -154,11 +216,8 @@ if has("python") let g:ycm_python_binary_path = 'python' " the python interpreter of choice (for code checking) " 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' " 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 + let g:ycm_key_list_select_completion=[] + let g:ycm_key_list_previous_completion=[] " SYNTASTIC: ========================================================================================================= @@ -222,8 +281,9 @@ function! ExtendColorTheme() " highlight Normal ctermbg=NONE ctermfg=black highlight! CursorLineNr cterm=inverse | " ctermbg=black ctermfg=NONE - highlight! Pmenu ctermbg=LightYellow ctermfg=blue guibg=blue guifg=LightYellow - highlight! PmenuSel ctermbg=LightYellow ctermfg=blue guibg=LightYellow guifg=blue cterm=italic + highlight! Pmenu ctermbg=LightYellow ctermfg=blue + highlight! PmenuSel ctermbg=blue ctermfg=LightYellow cterm=bold + highlight! link PmenuSbar Pmenu highlight! PmenuThumb cterm=inverse highlight! MoreMsg cterm=inverse @@ -233,6 +293,10 @@ function! ExtendColorTheme() highlight! SpellBad ctermbg=none highlight! SpecialKey ctermfg=19 highlight! WhiteSpace ctermfg=19 + + highlight! link TabLine LineNr + highlight! TabLineSel ctermbg=blue ctermfg=black + highlight! link TabLineFill LineNr endfunction autocmd ColorScheme * call ExtendColorTheme() @@ -272,66 +336,6 @@ set thesaurus+=/home/max/.vim/thesaurus/php.txt set dictionary=/usr/share/dict/cracklib-small set complete+=k " make default completer respect the dictionary -"======================================================================================================================= -" SETTINGS: -"======================================================================================================================= -set noautochdir | " When on, Vim will change the current working directory -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 -set complete+=d | " scan current and included files for defined name or macro -set complete+=i | " scan current and included files for completions -set concealcursor=nc | " limits the display of concealed text to normal and command mode -set conceallevel=2 | " replace escaped chars by their utf-8 representation (useful for LaTeX) -set confirm | " asks 'do you want to save?' -set cpoptions+=P | " makes :w filename set the current buffer to filename -set hidden | " allows switiching buffers even if the current buffer contains changes (displays +) -set hlsearch | " highlights all search matches (not as performant!) -set ignorecase smartcase | " search with ignorecase by default, but use case sensitive search when one captical char is contained -set lazyredraw | " disables redraw during macro exectution (improves performance) -set linebreak | " wrap long lines at char 'breakat', not inside words -set mouse=n | " allow mouse in normal mode only, so one can use the terminals c&p feature in insert mode -set mousemodel=popup | " only in gvim: right click opens a popup-menu -set nocursorcolumn | " turn visual cursor column off (improves performance) -set nocursorline | " turn visual cursor line off (improves performance) -set nrformats+=alpha | " allows CTRL-A & CTRL-X to increment and decrement letters, not just numbers -set nofoldenable | " disable code folding. I hate code folding -set foldmethod=syntax | " foldlevel: syntax, indent, manual -set foldcolumn=1 | " if code folding gets used display it in the clutter bar, where line numbers live -set foldclose=all | " automatically fold, when the cursor leaves the folded area -set foldopen=all | " unfold when cursor moves into the closed fold -set foldtext=Foldtext() | " -set foldnestmax=1 | " top level folding only -set relativenumber | " relative line numbers can speed up navigation -set noshowmode | " because we are using some powerline derivat -set nostartofline | " when scrolling: do not move the cursor to column 1 -set notimeout ttimeout | " improves performance but is known to cause problems on slow terminals -set ttimeoutlen=50 | " set esc key timeout in ms- -set nowrap | " but do not (by default) wrap long lines around -set number | " turn line numbers on/off (performance decreases when they are shown) -set pumheight=8 | " Determines the maximum number of items to show in the popup menu for -set path+=** | " allow recursive searches for files -set redrawtime=400 | " The time in milliseconds for redrawing the display. -" set restorescreen | " restores the console after exiting vim -" set shada+=n~/.vim/shada | " shada file to use -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 (BUT SLOW, makes cursor flickering) -" ret 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 textwidth=100 | " line length (80 used to be default, but...) -set textwidth=120 | " better done with modeline -" set colorcolumn= | " not used, because we have a :match directive for textwidth -set ts=4 sts=4 sw=4 expandtab | " better done with a modeline -set updatetime=1000 | " updates the screen more often -set writedelay=0 -set wildmenu | " use a menu in the command line -set wildmode=longest:full | " do not preselect any entry and show all possible -"======================================================================================================================= - " set fillchars+=stlnc:\― | " @@ -531,7 +535,9 @@ if has("autocmd") augroup CurrentFileName highlight CurrentFileName ctermbg=yellow guibg=yellow - let @w = ":execute ':match ColorColumn /\\%>'.&textwidth.'v./'" + + let @w = ":execute ':match ColorColumn /\\%>'.&textwidth.'v./' | :2match ExtraWhitespace /\\s\\+$/" + " let @w = ":execute ':match ColorColumn /\\%>'.&textwidth.'v./'" " highlight the current files name inside the document... let @g = ":exe ':match CurrentFileName /'.escape(expand('%:t'), '.').'/'" " put the current files name after the cursor... @@ -576,7 +582,7 @@ vnoremap k nnoremap q :bpspbnbd. nnoremap :make -nnoremap :silent syntax sync fromstart:nohlsearch:silent match +nnoremap :silent syntax sync fromstart:nohlsearch:silent match:silent 2match:silent 3match nnoremap r :syntax sync fromstart -- cgit v1.2.3