Xref: utzoo comp.editors:2694 alt.sources:3462 Path: utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!geac!alias!rudy From: rudy@alias.UUCP (Rudy Wortel) Newsgroups: comp.editors,alt.sources Subject: Re: Vi/Ex: command line editor? - Sort of. Message-ID: <1991Mar8.153222.14583@alias.uucp> Date: 8 Mar 91 15:32:22 GMT References: <1991Jan30.175602.400@convex.com> <4748@male.EBay.Sun.COM> <5104@lure.latrobe.edu.au> <2797@wn1.sci.kun.nl> <1991Mar6.145534.14349@unipalm.uucp> Sender: news@alias.uucp (USENET News) Organization: Alias Research, Inc. Toronto ON Canada Lines: 26 In article <5104@lure.latrobe.edu.au> ECSGRT@lure.latrobe.edu.au (GEOFFREY TOBIN, ELECTRONIC ENGINEERING) writes: > :.,.+3s/some long expression/another long expression/g... > OOPS! I mistyped something. > :BORING REPETITION WITH A ONE-CHARACTER CORRECTION >Command line editing for ex? Having done this same thing 5000 times my solution was to never type long : command at the command line. Instead i type them into the file where you get all your favorite editing features. i then delete the line into a named buffer and then execture the buffer with the @ command. To speed things up i have a macro for control X in my .exrc file the does the delete and execute for me. If the command didn't behave as expected then i undo the change put the buffer, edit and reexecute it. It works adequately for me. Here is my macro. It uses the named buffer 'd' map ^X "ddd@d As an aside you can exploit the function key maping to extend your macro set. VI lets you type # to simulate pressing a function key. The versions of vi i use don't check to make sure that the characters following the # are digits. i have many macros defined as # so that at last count i had 43 macros defined. -rudy