delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/06/15:07:02

From: eighner AT io DOT com (Lars Eighner)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: vim key commands - not too kool
Date: Mon, 06 Dec 1999 08:43:26 -0600
Organization: Lars Eighner, Author
Lines: 74
Message-ID: <Ou8S4AwZqwsC092yn@io.com>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 991206130052 DOT 19924F-100000 AT is>
<384BC8F4 DOT A616873B AT a DOT crl DOT com>
NNTP-Posting-Host: dillinger.io.com
Mime-Version: 1.0
X-Trace: hiram.io.com 944499480 31653 199.170.88.20 (6 Dec 1999 16:58:00 GMT)
X-Complaints-To: abuse AT io DOT com
NNTP-Posting-Date: 6 Dec 1999 16:58:00 GMT
X-Newsreader: Yarn 0.92 with YES 0.22
X-ISP: Illuminati Online
X-Revision: 1
Originator: eighner AT dillinger-2 DOT io DOT com (Lars Eighner)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In our last episode <384BC8F4 DOT A616873B AT a DOT crl DOT com>,
the lovely and talented Weiqi Gao <weiqigao AT a DOT crl DOT com>
broadcast on comp.os.msdos.djgpp:
|Eli Zaretskii wrote:
|> 
|> On Sun, 5 Dec 1999, Lars Eighner wrote:
|> 
|> > 1. shift F2 (search backwards)
|> > 2. o
|> > 3. esc (search on o)
|> > 4. backspace (rub o)
|> > 5. i (insert i)
|> > 6. home
|> > 7. home
|> > 8. down arrow (to end of document)
|> >   (or 6. home, 7. right arrow, 8. down arrow, to return to end
|> >   of second line if that is not the end of document)

6, 7, and 8 can be Ctrl-Home if it was the end-of-document.  Also
down arrow will work if the end of the second line is to the
left of the error.

|
|In vi, I would do:
|1. ESC (get out of editing mode)
|2. Fo (search backward for 'o' on the same line)
|3. ri (replace the current character by i)
|4. $ (go back to the end of the line again)

That takes you to the end of the NEXT line?  That was the
statement of the original problem.  The cursor begins on the
line following the error.  The problem does not quite make
clear whether this is the end of document or could be
a couple of lines being inserted somewhere in the middle of
a document.

|
|(That's six key strokes, a savings of 25%)
|
|> Here's the Emacs sequence that does the same:
|> 
|>   Ctrl-R (search in reverse)
|>   o (search for o)
|>   DEL (delete o)
|>   i (insert i)
|... and Ctrl-E (to go back to eol)
|
|(That's five key strokes, a savings of an additional 17%)

I think for the minimum in emacs that meets all the conditions
of the problem, you have to begin by dropping a mark and end
by switching the cursor and the mark.

The only keystroke saved is that from not having to terminal
the search string, owing to progressive searching in emacs --
which tends to make me dizzy without adding any real usefulness
that I can see.

|Here's an devil's advocate solution in EDIT:
|1. Back-arrow (hold it until the cursor is exactly on the 'o')
|2. i (you were typing in overwriting mode)
|3. Forward-arrow (hold it until the cursor reaches the end of line)
|
|(That's a total of three keystrokes, another savings of 40%)

Did they ever fix EDIT so it became possible to insert another
file without having to mess with the clipboard?

-- 
          Lars Eighner  700 Hearn #101 Austin TX 78703 eighner AT io DOT com
      (512) 474-1920 (FAX answers 6th ring) http://www.io.com/%7Eeighner/
              bookstore: http://www.io.com/%7Eeighner/bookstore/
           A pessimist complains about noise when opportunity knocks

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019