[TUHS] basic tools / Universal Unix

Ralph Corderoy ralph at inputplus.co.uk
Mon Oct 30 10:55:07 AEST 2017


Hi Bakul,

Regarding vi:
> As an example, you can map a key to do a sequence of operations but
> you you can’t then use it in conjunction with search to repeat them
> over a range of lines.

You can use tail recursion in the macro because a failed search causes
it to stop.  So `qqq' to start recording to register `q', and then
instantly stop recording, clearing it.  Then the real definition, ending
in an execution of the empty `q'.

    qq/4$^Ma2^[@qq

And finally an `@q' to kick off the recursion.

-- 
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy


More information about the TUHS mailing list