vim_current_word
vim_current_word copied to clipboard
When disabling highlight, highlights remain
When the cursor is on a word and twin words are highlighted, and when I then disable highlighting by running :let g:vim_current_word#enabled=0
, the highlighted words keep being highlighted. Expected behavior would be that they lose their highlighting.
I want to switch highlighting on and off using a shortcut because scrolling is rather slow when highlighting is turned off.
Oh... got it. You need to use :call vim_current_word#vim_current_word_disable()
instead of modifying the variable.
This function can be used to switch this plugin on and off:
function ToggleCurrentWord()
if g:vim_current_word#enabled == 1
call vim_current_word#vim_current_word_disable()
else
call vim_current_word#vim_current_word_enable()
call vim_current_word#highlight_word_under_cursor()
endif
endfunction
I’ll leave it to you to close this issue because this might be expected behavior after all.
why is the autocmd :let b:vim_current_word_disabled_in_this_buffer = 1
? Should we remove the :
?