I know that I can use set list listchars=... to display NonText and SpecialKey characters to highlight different types as well as non-text characters. In general, it works directly. But I have a visual side effect that bothers me - while the cursor “hovering” over the line when the cursor line is set to listchars is highlighted in a different color. The problem has already been mentioned in this thread , and there seems to be no solution for dealing with this behavior.
As a calculus, I started playing with a hidden function, which gives me mixed results. set concealcursor=n||v||i||c allows me to control in which modes hidden characters are visible. I want to always see hidden characters, so I configure the following:
function! ConcealNonText() set conceallevel=1 set concealcursor=nvic syntax match NonText / / conceal cchar=· endfunction augroup ConcealNonText autocmd! autocmd VimEnter * call ConcealNonText() augroup END
As a result, he highlights all the spaces that are always visible regardless of the mode in which I enter now. But again, there is an alarming side effect - when I mark lines in visual mode or select a line using my cursor line, the selection area is interrupted when hidden characters are found. Just view the screenshots:
Visual mode with selected area:

Normal mode with cursor:

So, I thought, let's try set concealcursor=ic . This results in continuous selection, but then the characters are hidden.

So, is there somewhere and somehow a solution for the stream that I mentioned at the beginning of this post, or is there a way to make the cursor and visual selection areas continuous by using set concealcursor=nvic ?
vim vim-syntax-highlighting
Saucier
source share