0

Is it possible to temporarily disable the text highlight under cursor?

The current highlight group can be obtained by synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name'). How to clear it to restore it later? One approach can be to save the match-pattern used for the highlight (obtain how?) and then clear the highlight group. While restoring the highlight, enable the cleared highlight group on the stored match-pattern.

Background

I want to reveal the concealed text around the cursor. On every CursorMoved event, I will locate the surrounding concealed text, store enough highlight info to re-conceal in future and clear the conceal-highlight (preferably clear only for the text under cursor).

2
0

getmatches() provides the match info including the pattern and match id. If the cursor location is included in the pattern match delete it using matchdelete().

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.