Open andreyorst opened 6 years ago
See also #453, in which code folding would be implemented by exactly the same mechanism.
This should be handled by the (existing but limited) replace-ranges
highglighter, and the (not existing yet) replace-regex
highlighter.
An additional feature we need is a way to specify empty ranges (so that we can introduce the :Unit
example), which we cannot now because we want to share the range syntax and the selection syntax (to make it easy to generate ranges from selections), and the selection syntax is necessarily inclusive (as selections are inclusive and oriented). As ranges support the
I've changed the issue name to represent the feature @mawww described in the previous comment.
I'm currently in process of updating my kaktree
plugin, and we decided to store path info in the buffer. I have a question: will we be able to use replaced info in its original state for other highlighters?
What I mean is, if we have this buffer:
item [[some additional info]]
other_item [[some other info]]
And we replace ranges with nothing by using replace-regex
highlighter.
What we actually see now:
item
other_item
Now we want to highlight other_item
because it has [[some other info]]
that matches our regular regex highlighter \w+\s+(?=\[\[some other info\]\])
. Will this work as if no replace-regex
were added?
@andreyorst I would expect that use case to work as a regex highlighter will match on the buffer text, independently of what is on screen.
Conceal is somewhat arcane feature of Vim, that allows to display text differently from how it actually stored in text document. It is widely used in Vim documentation, and another filetypes, to hide formatting symbols from eyesight. Concealing also can be used by various plugins to display information on a some point of line by dynamically generating conceal rules.
In short, concealing works this way: display "some text" from the file as "some other text" Usage cases:
:Unit
is displayed as concealed text)markdown
would be able to display such things like *bold text* as bold text.I think that conceal should be a regexp highlighter, that acts like show whitespaces but for any regexp matched text:
And so on.
While we're in insert mode on the same line with some concealed text, conceal maybe should be disabled, so we could see real contents of the line.