home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.editors
- Path: sparky!uunet!unipalm!ian
- From: ian@unipalm.co.uk (Ian Phillipps)
- Subject: Re: Command line editing in vi - a macro
- Message-ID: <1992Sep2.120742.21420@unipalm.co.uk>
- Organization: Unipalm Ltd., 216 Cambridge Science Park, Cambridge CB4 4WA, UK
- References: <1992Aug12.021145.5902@nuscc.nus.sg> <1992Aug27.052100.1716@ferret.uucp>
- Date: Wed, 2 Sep 1992 12:07:42 GMT
- Lines: 37
-
- stv@ferret.uucp (Steve Manning) writes:
-
- >In article <1992Aug12.021145.5902@nuscc.nus.sg> ccechk@nuscc.nus.sg (Heng Kek) writes:
- >> How may I 'recall' the last cmd I entered in vi in such
- >>a way that I can edit that command and execute it? Something like
- >>the history command editing in tcsh.
-
- >Whenever I find that I'm going to be constructing a long pattern
- >such as the one you list, I will take advantage of vi's ability to
- >execute the contents of a named buffer as a macro. Typing the
- >AT-symbol ('@') followed by a letter (in command mode, of course)
- >will do this. Of course, this does require you to take steps before-
- >hand to do it and so is not "history command editing".
-
- I find very useful the mapping:
- :map <some key> ms"syy@s`s
-
- Which uses buffer "s" and text mark "s". It obeys the current line as a
- command, so that if I put a suitable command into the buffer, I can run
- it. It returns the cursor to the same place using mark "s" - this is a
- luxury item, but very useful if the command reads a file, for example.
-
- I've had no troubles with the old or new SunOS vi (the "new" version
- announces itself as SVR3.1).
-
- I even went through a phase of using "vi" as my normal shell.
-
- Example - the ":r!date" was typed in, then the "Insert" key pressed:
-
- :r!date
- Wed Sep 2 12:58:35 BST 1992
-
- Ian
- --
- Ian Phillipps, Unipalm Ltd, 216 Science Park, Phone +44 223 420002
- Milton Road, Cambridge, CB4 4WA, England. Phax +44 223 426868
- The road to hell is paved with melting snowballs - Larry Wall
-