I have an editor I am attempting to emulate that has some very nice features. One feature of the editor is to hide lines of a file (similar to a fold but without decorations) and apply commands operations only to those lines which remain visible. The hidden lines can then be brough back.
For example the user sees
Smurf Apple Bubble Tree Dog
The user says show-non-matching-lines (SNML) e
Smurf Dog
The user runs a command paste-after-line (PAL) followed by a token, $ say, and gets
Smurf$ Dog$
The user says show-all-lines (SAL)
Smurf$ Apple Bubble Tree Dog$
I know this is doable in VIM but I am at a loss at how to store per line properties without resorting to modifying the lines in some way. Please nudge me in the right direction or way of thinking...
Update: Using
:set foldtext=MyFoldingFunction
I can manipulate how text is folded with help from the following variables
v:foldstart Line num of 1st folded line
v:foldend Line num of last folded line
I guess I would have to enumerate all the folds while applying functions as I am applying text formatting and figure out if a line is folded away. I really want a method to store per line properties in vim... I guess I am out in the dark corners here.