I am new to vimscript. I am trying to figure out how plugins like vimwiki or vim-note reformat the visible text.
I know how to use the syntax highlighter to highlight, bold, underline, strikethrough, etc.
However these plugins change the visible text when the cursor moves away from the line. When the cursor is returned to the line, the text is re-rendered to show what was typed in.
Here is an example (vimwiki), I can type
*bold* when I move the cursor away it is turned into bold, when I bring the cursor back to the line it is re-rendered as
How is this technique achieved. I did look through vimwiki source (which is very complicated), I looked at vim-note as well but couldn't figure out where they do the switch (I would have figured there would be a mapping for
Do they keep 2 buffers, one visible, one hidden?
In vim-note, are they using vimscript undo to achieve this technique? If so how does it work?