Path: utzoo!attcan!uunet!samsung!munnari.oz.au!goanna!minyos!s887212 From: s887212@minyos.xx.rmit.oz (Stephen Riehm [Romulis]) Newsgroups: comp.editors Subject: Loops in VI macros? Keywords: vi, macros Message-ID: <5973@minyos.xx.rmit.oz> Date: 7 Oct 90 10:27:21 GMT Organization: RMIT Computer Centre, Melbourne Australia. Lines: 26 is it possible to create a macro useing vi's map and map! functions that will loop until some condition has become true? for exapmle I use the following map to format my C code (rather than putting up with the tabs that cb seems to like to use). It works ok, but if I want to do a whole file I have to left shift the entire file.. then repeatedly use my macro until I get to the bottom of the file. Also this could be used as a nice temporary fix to the problem of the ~ (convert lower to upper case and vice versa) being only a single stroke command. ------- # 3 is a 'Civilised' indent width :set sw=3 #map to put some sort of organisation into C code :map @ /{^M>%<<^M^G #note that ^ indicates ctrl character. ------ thanx in advance ============================================================================ Romulis [Stephen Riehm] Royal Melbourne Institute of Technology, (124 Latrobe St., Melbourne.) s887212@minyos.xx.rmit.oz.au Australia. @>---`--,--( Still Stuck on the wrong side of the deep pink sea )--.--'---<@ ======================< Insert Usual Disclaimer >===========================