From 3377b86a73ce6f13bc43dac24a8bdf80be5f4cc0 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sun, 15 Oct 2017 19:31:28 +0200 Subject: Major refactoring, added many menues and comfort features --- vimrc-full | 412 +++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 252 insertions(+), 160 deletions(-) (limited to 'vimrc-full') diff --git a/vimrc-full b/vimrc-full index 4e73d20..bbfeafa 100644 --- a/vimrc-full +++ b/vimrc-full @@ -9,9 +9,12 @@ "======================================================================================================================= " GENERAL: "======================================================================================================================= -set textwidth=120 | " better done with modeline -set ts=4 sts=4 sw=4 expandtab | " better done with a modeline -set redrawtime=1000 | " Timeout in milliseconds for redrawing the display / CTRL+L to retry +set exrc | " enable exrc, a specific .exrc per project, which can contain usual .vimrc commands +set textwidth=120 | " better done with modeline or local exrc +set ts=4 sts=4 sw=4 expandtab | " better done with a modeline or local exrc +set virtualedit=all | " virtual edit should be default behaviour, because I don't see any reason against +set number norelativenumber | " turn line numbers on/off (performance decreases when they are shown) +set ignorecase smartcase hlsearch | " search with ignorecase by default, but use case sensitive search when one captical char is contained and highlight while typing (even though its slower) "======================================================================================================================= " SHELL @@ -89,42 +92,51 @@ if has('cscope') " compiled with cscope support? endif if has('menu') - menu &Cscope.create\ and\ add\ database - \ :execute '!find -regex ".*\.\(c\\|h\\|cpp\\|cxx\\|hh\\|hpp\\|hxx\)$" cscope -i- -b -q':cscope kill -1:cscope add . - menu &Cscope.-Sep- - \ : - menu &Cscope.find.C\ symbol - \ :cscope find s - menu &Cscope.find.definition - \ :cscope find g - menu &Cscope.find.functions\ called\ by\ this - \ :cscope find d - menu &Cscope.find.functions\ calling\ this - \ :cscope find c - menu &Cscope.find.text\ string - \ :cscope find t - menu &Cscope.find.egrep\ pattern - \ :cscope find e - menu &Cscope.find.this\ file - \ :cscope find f - menu &Cscope.find.files\ including\ this\ file - \ :cscope find i - menu &Cscope.find.places\ where\ this\ symbol\ is\ assigned\ a\ value - \ :cscope find a - menu &Cscope.-Sep- - \ : - menu &Cscope.add - \ :cscope add . - menu &Cscope.show - \ :cscope show - menu &Cscope.reset - \ :cscope reset + menu &:cscope.find.c\ symbol + \s + \ :cscope find s <:cR> + menu &:cscope.find.definition + \g + \ :cscope find g <:cR> + menu &:cscope.find.functions\ called\ by\ this + \d + \ :cscope find d <:cR> + menu &:cscope.find.functions\ calling\ this + \c + \ :cscope find c <:cR> + menu &:cscope.find.text\ string + \t + \ :cscope find t <:cR> + menu &:cscope.find.egrep\ pattern + \e + \ :cscope find e <:cR> + menu &:cscope.find.this\ file + \f + \ :cscope find f <:cR> + menu &:cscope.find.files\ including\ this\ file + \i + \ :cscope find i <:cR> + menu &:cscope.find.places\ where\ this\ symbol\ is\ assigned\ a\ value + \a + \ :cscope find a <:cR> + menu &:cscope.-Sep1- + \ : + menu &:cscope.create\ and\ add\ database + \ :cscope kill -1:execute '!find -regex ".*\.\(c\\|h\\|cpp\\|cxx\\|hh\\|hpp\\|hxx\)$" cscope -i- -b -q':cscope add . + menu &:cscope.-Sep2- + \ : + menu &:cscope.add\ \. + \ :cscope add . + menu &:cscope.show + \ :cscope show + menu &:cscope.reset + \ :cscope reset endif endif -" ======================================================================================================================= +" ====================================================================================================================== " GUI_VERSION -" ======================================================================================================================= +" ====================================================================================================================== if has("gui_running") set guicursor=a:block-blinkon100 set browsedir=buffer @@ -145,82 +157,91 @@ if has("gui_running") " its possible to define alternative fonts (order matters) set guifont= - set guifont+=Dejavu\ Sans\ Mono\ for\ Powerline\ Semibold - set guifont+=RobotoMono\ Nerd\ Font\ Medium\ 10 + set guifont+=Source\ Code\ Pro\ for\ Powerline\ SemiBold\ 10 set guifont+=LiterationMono\ Nerd\ Font\ Mono\ 10 + set guifont+=RobotoMono\ Nerd\ Font\ Medium\ 10 set guifont+=Source\ Code\ Pro\ Semi-Bold\ 10 - set guifont+=Source\ Code\ Pro\ for\ Powerline\ SemiBold\ 10 + set guifont+=Dejavu\ Sans\ Mono\ for\ Powerline\ Semibold set guifont+=Droid\ Sans\ Mono\ for\ Powerline\ 10 set guifont+=Meslo\ LG\ M\ for\ Powerline\ 10 + + " like in the terminal: use ctrl-shift-v for paste in vim's command editor + cnoremap * endif -" ======================================================================================================================= +" ====================================================================================================================== " 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 colorcolumn= | " not used, because we have a :match directive for textwidth 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 nrformats+=alpha | " allows CTRL-A & CTRL-X to increment and decrement letters, not just numbers -set nofoldenable | " disable folding, because we have zi to toggle foldenable :) -set exrc | " enable exrc, a specific .exrc per project, which can contain usual .vimrc commands -set foldmethod=syntax | " foldlevel: syntax, indent, manual -set foldcolumn=0 | " I think I don't need this second indicator -set foldclose=all | " automatically fold, when the cursor leaves the folded area -set foldopen=block,hor,search | " when do we unfold? -set foldtext=Foldtext() | " -set foldnestmax=1 | " top level folding only -set norelativenumber | " relative line numbers can speed up navigation, but I could not get used to it till now -set noshowmode | " because we are using some powerline derivat +set mouse=n | " allow mouse in normal mode only, so one can use the terminals c&p feature in insert mode +set noautochdir | " When on, Vim will change the current working directory 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 nrformats+=alpha | " allows CTRL-A & CTRL-X to increment and decrement letters, not just numbers set path+=** | " allow recursive searches for files +set pumheight=8 | " Determines the maximum number of items to show in the popup menu for 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 scrolloff=0 | " keeps cursor centered set shiftround | " indent/unindent snaps to multiple of shiftwidths -set shortmess+=I | " don't give the intro message when starting Vim |:intro|. -set showcmd | " essential: show keys of combined commands in the lower right corner (BUT SLOW, makes cursor flickering) +set writedelay=0 + +" display and performance +set lazyredraw | " disables redraw during macro exectution (improves performance) +set cmdheight=2 | " sets the command line's height set signcolumn=yes | " auto=auto hide, yes=always, no=never show the column with error indicators -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=0 | " (and all other windows, so TODO: watch out) -set tags+=../tags -set tagcase=match | " tagcase match, because we mostly use ^] to jump around and that variant respects the upper/lower case [followscs, followic, match, ignore] +set nocursorcolumn | " turn visual cursor column off (improves performance) set updatetime=80 | " updates the screen more often -set viminfo+=% | " restore buffer list -set virtualedit=all | " virtual edit should be default behaviour, because I don't see any reason against -set writedelay=0 +set redrawtime=1000 | " Timeout in milliseconds for redrawing the screen (switches syntax off when ssh too slow) / CTRL+L to retry +set notimeout | " improves performance but is known to cause problems on slow terminals +set ttimeout ttimeoutlen=50 | " set esc key timeout in ms- +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 shortmess+=I | " don't give the intro message when starting Vim |:intro|. set wildmenu | " use a menu in the command line set wildmode=longest:full | " do not preselect any entry and show all possible + +" code completion +set complete+=d | " scan current and included files for defined name or macro +set complete+=i | " scan current and included files for completions +set tagcase=match | " tagcase match, because we mostly use ^] to jump around and that variant respects the upper/lower case [followscs, followic, match, ignore] +set tags+=../tags + +" code folding... +set nofoldenable | " disable folding, because we have zi to toggle foldenable :) +set foldclose=all | " automatically fold, when the cursor leaves the folded area +set foldcolumn=0 | " I think I don't need this second indicator +set foldmethod=syntax | " foldlevel: syntax, indent, manual +set foldnestmax=1 | " top level folding only +set foldopen=block,hor,search | " when do we unfold? +set foldtext=Foldtext() | " + +" vim window behaviour +set splitbelow | " open new windows below the current one (i find that more intuitive) +set winminwidth=0 | " (and all other windows, so TODO: watch out) +set winwidth=30 | " keep NERDTreeWindow at least this size + + +" vim session handling and restore behaviour +set viminfo+=% | " restore buffer list set sessionoptions= set sessionoptions+=buffers set sessionoptions+=curdir set sessionoptions+=folds +set sessionoptions+=resize +set sessionoptions+=slash set sessionoptions+=tabpages +set sessionoptions+=unix set sessionoptions+=winpos set sessionoptions+=winsize -set sessionoptions+=resize -set sessionoptions+=unix -set sessionoptions+=slash + " set nocindent smartindent | " use smart indent rather then cindent set noautoindent @@ -255,7 +276,6 @@ else " default Vim? set ttyscroll=100 | " improves speed for terminal vim, incomp. with nvim set ttyfast | " improves speed for terminal vim (incomp. with nvim) set nottybuiltin | " use external termcaps - " set termguicolors | " When on, uses highlight-guifg and highlight-guibg attributes in the terminal (=24bit color) incomp. with nvim set restorescreen | " restores the console after exiting vim (intentionally not in nvim) " let g:loaded_ruby_provider = 1 " disable ruby support @@ -408,45 +428,93 @@ if has("autocmd") set wcm= map :emenu - menu &Chdir.Git\ root:Gcd - \ :Gcd:pwd + menu &Directory.print\ current\ directory + \:pwd + \ :pwd + + menu &Directory.-Sep- : + + menu &Directory.Change\ to\ GIT\ root + \:Gcd + \ :Gcd:pwd - menu &Chdir.current\ buffer:cd\ %:h - \ :cd %:h:pwd + menu &Directory.Change\ to\ current\ buffers\ directory\ (global) + \:cd\ %:p:h + \ :cd %:h:pwd - menu &Chdir.current\ buffer:lcd\ %:p:h - \ :lcd %:p:h:pwd + menu &Directory.Change\ to\ current\ buffers\ directory\ (local\ window):lcd\ %:p:h + \ :lcd %:p:h:pwd menu &Git.&Display\ last\ changes - \ :let g:signify_vcs_cmds={'git': 'git diff --no-color --no-ext-diff -U0 HEAD^ -- %f'}:SignifyRefresh + \ :let g:signify_vcs_cmds={'git': 'git diff --no-color --no-ext-diff -U0 HEAD^ -- %f'}:SignifyRefresh - menu &UI.&Open\ in\ Serversession - \ :execute ':!nvr --servername /tmp/nvimsocket --remote % +'.line('.'):stopinsert:set readonly + menu &Match.Clear\ All\ Matches + \ + \ :call clearmatches() + + menu &Match.-Sep- : + + menu &Match.&dispensable\ white\ spaces + \ :call matchadd("Convention", '\s\+$', 0) + + menu &Match.&long\ lines\ (exeeding\ textwidth) + \ :call matchadd("Convention", '\%>'.&textwidth.'v.', 0) - menu &Verify.&Textwidth\ and\ white\ space - \ :execute ':match Error /\%>'.&textwidth.'v./' - \ :2match Error /\s\+$/ + menu &Match.Highlight\ current\ file\ name + \ :call matchadd("Search", escape(expand('%:t'), '.')) + + " :execute ':match SpellBad /'.escape(expand('%:t'), '.').'/' - menu &Verify.Highlight\ current\ file\ name - \ :execute ':match SpellBad /'.escape(expand('%:t'), '.').'/' menu &Window.-Sep- : menu &Window.Quickfix\ List - \ :copen + \ :copen menu &Window.Location\ List - \ :lopen + \ :lopen menu &Window.Scratch - \ :Scratch - - menu &Find.file\ under\ the\ cursor:gf - \ gf + \ :Scratch + + + menu &Find.file\ under\ the\ cursor + \gf + \ gf + + menu &Find.Open\ search\ results\ in\ location\ list + \:gf + \ :execute ':vimgrep /'.escape(getreg('/'), '.').'/g %' + \ :copen + + menu &Changes.list + \:changes + \ :changes + menu &Changes.-Sep- : + menu &Changes.previous + \g; + \ g; + menu &Changes.next + \g, + \ g, + + menu &Jump.list + \:jumps + \ :jumps + menu &Jump.-Sep1- : + menu &Jump.previous\ position + \CTRL-O + \ + menu &Jump.next\ position + \CTRL-I + \ + menu &Jump.-Sep2- : + menu &Jump.clear\ list + \:clearjumps + \ :clearjumps + menu &UI.&Open\ in\ Serversession + \ :execute ':!nvr --servername /tmp/nvimsocket --remote % +'.line('.'):stopinsert:set readonly - menu &Find.Open\ search\ results\ in\ location\ list:gf - \ :execute ':vimgrep /'.escape(getreg('/'), '.').'/g %' - \ :copen endif @@ -618,26 +686,31 @@ let g:lightline_buffer_reservelen = 20 " \ 'left': [ [ 'bufferinfo' ], [ 'bufferbefore', 'buffercurrent', 'bufferafter' ], ], let g:lightline = { \ 'tabline': { - \ 'left': [ [ 'bufferinfo' ], [ 'bufferbefore', 'buffercurrent', 'bufferafter' ], ], - \ 'right': [ [], [ 'close' ] ], + \ 'left': [ [ 'bufferinfo', 'absolutepath' ] ], + \ 'right': [ [], [ 'buffer_alt' ] ], \ }, - \ 'colorscheme': 'Tomorrow_Night_Bright', + \ 'colorscheme': 'Tomorrow_Night', \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" }, \ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" }, \ 'inactive': { - \ 'left': [['readonly', 'gitbranch', 'absolutepath']]}, + \ 'left': [ ['gitbranch', 'filename'] ], + \ 'right': [ [ 'percent', 'lineinfo' ], + \ [ 'spell', 'fileencoding', 'fileformat', 'filetype' ] + \ ] + \ }, \ 'active': { \ 'left': [ [ 'mode', 'paste', 'readonly' ], - \ [ 'gitbranch', 'absolutepath' ], + \ [ 'gitbranch', 'filename' ], \ [ 'tagbar' ] ], \ 'right': [ [ 'percent', 'lineinfo' ], \ [ 'spell', 'fileencoding', 'fileformat', 'filetype' ] - \ ], + \ ] \ }, \ 'component': { \ 'tagbar': '%{substitute(tagbar#currenttag("%s", "", "fs"), "\(.*\)", "", "")}', \ 'ycmparent': '%{substitute(execute("YcmComplete GetParent"), "\(.*\)", "", "")}', - \ 'filename': '%t' + \ 'filename': '%t', + \ 'buffer_alt': '#:%{expand("#:t")}' \ }, \ 'component_expand': { \ 'buffercurrent': 'lightline#buffer#buffercurrent2', @@ -657,45 +730,67 @@ let g:lightline = { \ }, \ } -function! ExtendLightlineColorTheme() - highlight! link LightlineMiddle_normal Normal -endfunction - -autocmd! ColorScheme * call ExtendLightlineColorTheme() +set noshowmode | " mode will be shown twice, in lightline and below, so we want to deactivate one +set statusline= +set statusline+=%t%m +set statusline+=%{TagInStatusLine()} +set statusline+=%#warningmsg# +set statusline+=%{SyntasticStatuslineFlag()} +set statusline+=%*%= +set statusline+=%l:%c(%p%%) " Autocompleter: ===================================== " if has("python") + + " ULTISNIPS: code snippet ============================================================================================ + Plug 'honza/vim-snippets' " dependency of ultisnips (see below) + Plug 'SirVer/ultisnips' " replaces loremipsum (and many more) + let g:UltiSnipsExpandTrigger = ''| " expands the snippet, be careful not to use elsewhere (ycm uses it by default, but it has been deactivated by g:ycm_key_list_select_completion) + + let g:UltiSnipsJumpForwardTrigger = ''| + let g:UltiSnipsJumpBackwardTrigger = ''| + "d let g:UltiSnipsJumpForwardTrigger = '' + " let g:UltiSnipsJumpBackwardTrigger = '' + "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 + """ Ultisnips + " let g:UltiSnipsExpandTrigger="" + " let g:UltiSnipsListSnippets="" + " YouCompleteMe: ===================================================================================================== " Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... Plug 'Valloric/YouCompleteMe' - " Plug 'vim-scripts/dbext.vim' " dependency to allow db related completions - let g:ycm_server_python_interpreter = 'python3' - let g:ycm_python_binary_path = '/usr/bin/python3' " the python interpreter of choice (for code checking) - 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 = 0 " 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_auto_trigger = 1 - let g:ycm_min_num_of_chars_for_completion = 6 " we normally avoid identifier based completion, it just helps with long words. Use semantic completions with instead - let g:ycm_min_num_identifier_candidate_chars = 4 - - let g:ycm_max_num_identifier_candidates = 10 - let g:ycm_max_num_candidates = 50 - - - 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 = '.ycm_extra_conf.py' - let g:ycm_semantic_triggers = { 'c': [ 're!.' ] } - " let g:ycm_disable_for_files_larger_than_kb = 16384 " we have faaast computers, don't we? - let g:ycm_show_diagnostics_ui = 0 - " disable -key for YCM so that it can be used with ultisnips + let g:ycm_auto_trigger = 1 + let g:ycm_autoclose_preview_window_after_insertion = 1 + " Plug 'vim-scripts/dbext.vim' " dependency to allow db related completions + " let g:ycm_server_python_interpreter = 'python3' + " let g:ycm_python_binary_path = '/usr/bin/python3' " the python interpreter of choice (for code checking) + " let g:ycm_add_preview_to_completeopt = 1 " reuse existing preview window + " let g:ycm_collect_identifiers_from_tags_files = 0 " 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_min_num_of_chars_for_completion = 6 " we normally avoid identifier based completion, it just helps with long words. Use semantic completions with instead (terrible idea, html snippets not working!) + " let g:ycm_min_num_identifier_candidate_chars = 4 + + " let g:ycm_max_num_identifier_candidates = 10 + " let g:ycm_max_num_candidates = 50 + + + " let g:ycm_use_ultisnips_completer = 1 " Default 1, just ensure + " 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 = '.ycm_extra_conf.py' + " let g:ycm_semantic_triggers = { 'c': [ 're!.' ] } + " " let g:ycm_disable_for_files_larger_than_kb = 16384 " we have faaast computers, don't we? + " let g:ycm_show_diagnostics_ui = 0 + " " 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=[] @@ -720,18 +815,6 @@ autocmd! ColorScheme * call ExtendLightlineColorTheme() let g:syntastic_warning_symbol = '➔' let g:syntastic_style_warning_symbol = '≈' - " 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 - " 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 @@ -799,7 +882,7 @@ function! ExtendColorTheme() " highlight! NonText guibg=NONE guifg=black ctermbg=NONE ctermfg=black " make the ~ (tilde) indicator invisible, which usually marks the EOF - highlight! EndOfBuffer ctermfg=bg + highlight! link EndOfBuffer Ignore highlight! CursorLineNr cterm=inverse | " ctermbg=black ctermfg=NONE highlight! Pmenu ctermbg=LightYellow ctermfg=DarkGrey @@ -830,16 +913,27 @@ function! ExtendColorTheme() highlight! link SpecialKey NonText - " Show trailing whitepace and spaces before a tab as part of the syntax highlighting - autocmd Syntax * syn match Error /\s\+$\| \+\ze\t/ containedin=ALL " automatically enter list mode when going in insert mode (makes above syntax command temporarily ineffective) autocmd InsertEnter * set list autocmd InsertLeave * set nolist + + " Show trailing whitepace and spaces before a tab as part of the syntax highlighting + highlight! link Convention Error + autocmd BufEnter,InsertLeave * syntax match Convention /\s\+$\| \+\ze\t/ containedin=ALL + autocmd InsertEnter * syntax clear Convention + " autocmd BufEnter,InsertLeave * execute ':syntax match Convention /\%>'.&textwidth.'v./ containedin=ALL' + + autocmd InsertEnter * set colorcolumn=80,120 + autocmd InsertLeave * set colorcolumn& + " set colorcolumn= | " not used, because we have a :match directive for textwidth + endfunction autocmd! ColorScheme * call ExtendColorTheme() -" colorscheme PaperColor +set termguicolors | " When on, uses highlight-guifg and highlight-guibg attributes in the terminal (=24bit color) incomp. with nvim +" set background=dark +set t_ut= if filereadable(expand("~/.config/base16-shell/colortest")) let g:base16_shell_path="~/.config/base16-shell/scripts" endif @@ -851,7 +945,6 @@ else colorscheme base16-phd endif -" set background=dark " ====================================================================================================================== " TESTING: @@ -861,8 +954,7 @@ endif " silent autocmd VimEnter * nested :silent bun " endif -set scrolloff=0 | " keeps cursor centered autocmd VimEnter,WinEnter * exec ':set scrolljump='.winheight(0)/2 - + " display highlight group under the cursor map h :echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")') -- cgit v1.2.3