From dede3ace49e934280e01f30050ce980b57a6a4d9 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Fri, 9 Jun 2017 17:29:36 +0200 Subject: tried --- vimrc-full | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/vimrc-full b/vimrc-full index ebe3134..1344f7e 100644 --- a/vimrc-full +++ b/vimrc-full @@ -68,7 +68,7 @@ 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=100 | " updates the screen more often +set updatetime=10 | " updates the screen more often set viminfo+=% | " restore buffer list set writedelay=0 set wildmenu | " use a menu in the command line @@ -233,7 +233,7 @@ if has("python") let g:ycm_global_ycm_extra_conf = '.ycm_extra_conf.py' let g:ycm_semantic_triggers = { 'c': [ 're!.' ] } let g:ycm_python_binary_path = 'python' " the python interpreter of choice (for code checking) - let g:ycm_disable_for_files_larger_than_kb = 16384 " we have faaast computers, don't we? + " let g:ycm_disable_for_files_larger_than_kb = 16384 " we have faaast computers, don't we? " disable -key for YCM so that it can be used with ultisnips let g:ycm_key_list_select_completion=[] @@ -659,13 +659,18 @@ let g:netrw_winsize = 20 | " window size in percent function! HighlightWordUnderCursor() - if getline(".")[col(".")-1] !~# '[[:punct:][:blank:]]' - exec 'match' 'Bold' '/\V\<'.expand('').'\>/' - else - match none + highlight WordBold cterm=bold gui=bold + + let l:currentword = escape(expand(''), '.') + exec 'syn clear' 'WordBold' + if(strlen(l:currentword) > 0) + " exec '2match' 'WordBold' '/'.l:currentword.'/' + " exec 'syn match' 'WordBold' '/'.l:currentword.'/' + if getline(".")[col(".")-1] !~# '[[:punct:][:blank:]]' + exec '2match' 'Bold' '/\V\<'.l:currentword.'\>/' + endif endif endfunction - autocmd! CursorHold,CursorHoldI * call HighlightWordUnderCursor() " au BufNewFile,BufRead,BufEnter *.cpp,*.hpp set omnifunc=omni#cpp#complete#Main -- cgit v1.2.3