0

the virtual text makes vim/neovim very powerful
I want to use the conceallevel to change some text virtually, using the regex or treesitter

  • replace > with one char:
" vim > > >
:syn match XXX ">" conceal cchar=▶

will look like this:

" vim ▶ ▶ ▶
:syn match XXX "▶" conceal cchar=▶
  • replace > with the string test
" vim > > >
:syn match XXX ">" conceal ???=test

to look like this:

" vim test test test
:syn match XXX "test" conceal ???=test
1
  • 2
    Vim supports only a single character of conceal. NeoVim's virtual text is different, IIUC.
    – D. Ben Knoble
    Jul 22 at 1:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy