Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!ncrlnk!ncrstp!npdiss1!mercer From: mercer@npdiss1.StPaul.NCR.COMDan Mercer) Newsgroups: comp.editors Subject: Re: Typing long commands in vi Message-ID: <167@npdiss1.StPaul.NCR.COM> Date: 15 Aug 90 21:33:39 GMT References: <56433@microsoft.UUCP> <3672@aspect.UUCP> Reply-To: mercer@npdiss1.StPaul.NCR.COM (Dan Mercer) Organization: StPaul Lines: 44 In article <3672@aspect.UUCP> dave@aspect.UUCP (Dave Corcoran) writes: :In article <56433@microsoft.UUCP>, steveha@microsoft.UUCP (Steve Hastings) writes: :> The other way uses named buffers and the @ command. The @ command executes :> a command stored inside a named buffer. So open a new line right in your :> source text, type the command then and there, and use the yank command to :> put it in a named buffer. Once it is in there, execute the command as many :> times as you want with @. If you made a typing error or want to change the :> command, edit the line and yank it again. If you deleted the original :> line, paste that buffer back in, edit it, and yank it again. : :All is fine unless the macro chokes: : :I have one objection to using the technique of putting editing macro :in a register (say z) and using @z to invoke it. The vi (visual interface) I :use gobbles the macro if an error was encountered during execution and I :cannot retrieve it with : : "zp : It isn't the macro that is gobbled, it is the macro process that must be unblocked. Just yank something into a different register and you now will find that you can retrieve your original macro. For instance, the macro: yyppppp when invoked returns the error message: Cannot put inside global/macro A "zp will now not recover the macro. However a "ayy"zp will recoevr it. In fact, so will a yy"zp. Interestingly enough, when I invoked the macro on the last line in this file, the first line was copied after it and the cursor moved to the new line. But the line wasn't really in the file! A ^L caused it to be redisplayed, but after moving the cursor off it, it couldn't be moved back on the line. Very strange (I've seen it before). -- Dan Mercer Reply-To: mercer@npdiss1.StPaul.NCR.COM (Dan Mercer) "MAN - the only one word oxymoron in the English Language"