When I hit /
in vim and search for $
it highlights all eols. But when I try to match them with syntax match
it does not seem to work.
function! ConcealNonText()
set conceallevel=1
set concealcursor=v
syntax match NonText /$/ conceal cchar=¶
endfunction
augroup ConcealNonText
autocmd!
autocmd VimEnter * call ConcealNonText()
augroup END
Any hints how I could match it in order to display eols as concealed chars?
I know I could use set list listchars
but that has some visual side effects in my opinion.
Looks like your requirement is to show ¶
in place of the eol. Although the code you have given maybe a possible solution, but it surely is not an ideal one. Vim provides a much simpler way of achieving what you wish. What you really need to do is lookup :h listchars
.
Following is an example of what you should put in your vimrc to achieve what you desire :
set list
set listchars+=eol:¶
Once you put this, vim will show the character ¶
for the eol character.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With