My problem is rather simple : I use a macro to wrap my current visual selection with some text (\verb;
and ;
, in fact).
The current macro I use is :s#\%V.*\%V#\\verb;\0;
. It works, but suffers from one problem : subsitutions always jump at the beginning of the line the cursor is on.
I would like to keep my cursor where it is to continue editing right where I did the subsitution or, alternatively, jump at the beginning/end of the substituted text. Is such a thing possible ? I've had a quick look at the substitute
help, but there doesn't seem to be such a flag. I am not sure where to look for a global toggle of this behavior, either.
If possible, I would like to be able to keep this behavior for this macro only, however it is not too important and having a global toggle for this behavior would work, too.
Many thanks for your help !
`>^[a;^[gv`<^[i\verb;^[
does the trick but needs some refinement (^[ means escape).