But what I'd like to is have vim put in the markers itself,
based on a regex I give it. So I suppose I need some sort of
exec command the kind used in unix find, etc. i.e.

:%s/myfabregex/exec "ma"/g

of course that will only work for the first marker, so I will
need a loop that increments alphabetically, which I also don't
know how to do (numerically, yes)

Would that be possible? The idea is that I could navigate long
documents using the markers.


Yes it's possible (I presume you mean "norm" rather than "exec" as "exec" gets you the ex command, while "norm" gives you the normal command)...though you'd have to define what sort of behavior you want if there are more than 26 hits for your regexp in the document. The basic "command" (okay, it several commands that could be mapped as one) would be something like this untested:

:let i=0 | g/re/exec "k".nr2char(97+(i>25? 25 : i) | let i+=1

The behavior here is that if you have more than 26 matches, the first 25 are tagged, and then the 26th marks the last hit, so 26..N-1 are unmarked.

Tinker to taste.

-tim



Reply via email to