[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs guy needs vi hack

On Mon, Jul 09, 2001 at 10:12:23AM -0500, Gary wrote:
> On Mon, Jul 09, 2001 at 08:51:20AM -0500 or thereabouts, Danny Sauer wrote:
> > On Mon, Jul 09, 2001 at 07:42:45AM -0700, Robert Threet wrote:
> > > Arrrgh!  I removed emacs (due to drive space and
> > > because I use pico most of the time) and now I need to
> > > delete the first 7974 lines of an 11,526 line file
> > > (boy, is my finger tired).  I have a unique word on
> > > line 7974...  I tried tail -n 3552 <file> but it
> > > didn't work.  Evidently, it can only go back so far...
> > >  I know you can do this in vi but if it takes me much
> > > longer to find out I may as well go back to hitting
> > > "dd dd dd dd...".  :-)
> > Move to the top line
> > type "d 7973 j" without the quotes and spaces
> > enjoy the power and memory savings of Vi
> Interesting, and it does work.  I learned just to type <esc>3552dd or 3552D
> and it does the same thing.  Wonder what the j does?  For me, vi(m) is so
> much faster keystroke wise, than emacs.  When using emacs, I use the viper
> mode to emulate vim. 

Yeah, that would work too.

"j" is the "down" command.  As you know, prefixing a command by a
number repeats that command that number of times.  The "d" command
requires one more thing after it to tell what to delete.  If you
type dd, it deletes a line., dw deletes a word.  If you stick a
number in there, d3w, you delete 3 words.  Therefore, d100j will
delete the current line and the next 100 lines down.  I use dj
fairly often (or, more often, c100j) while replying to email with
mutt. :)

To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.