bash gurus

Brad De Vries devriesbj
Mon May 17 11:33:35 PDT 2004


Sorry Joel, I don't think there is a way to map a key
(with :map or :map!) while performing in-line command
editing.  There is, however, the "v" command which
will take you to a vim editor with the command as the
one and only line to edit.  Once you get out of vim,
the entire file will be executed, regardless of
whether or not you saved any changes.  I find this
feature virtually indispensable when performing the
little commands like:
  for i in *.txt; do
    j=`basename $i .txt`.dat
    mv $i $j
  done

HTH.
Brad.
--- Joel Hammer <Joel at HammersHome.com> wrote:
> Thanks for that tip. One more (very good) reason to
> use vi.
> Now, is there a way to map keys like .vimrc files?
> Joel
> 
> On Wed, Jun 19, 2002 at 02:31:29PM -0700, Brad De
> Vries wrote:
> > Bash allows you to use an emacs or vi style
> in-line
> > editing feature.  I prefer vi-style, so I would
> use
> > something like:
> > 
> > # set -o vi   <-- kick it into vi-style
> > # <ESC>/abc   <-- <ESC> starts a vi command, in
> this
> > case the command is "/" or search and the text to
> > search for is "abc".  Keep pressing "n" to find
> the
> > next matching command and <ENTER> to execute it
> again.
> > 
> > BTW, you can use virtually all vi-commands right
> on
> > the command line.
> > 
> > Good luck.
> > Brad.
> > 
> > --- Nate Cole <cole_n_g at yahoo.com> wrote:
> > > All,
> > > 
> > > I have a question for all you bash gurus.  I
> like
> > > the way when
> > > the "up" arrow is pressed, it cycles through the
> > > history of
> > > commands.  What I want to do is type a few
> letters
> > > and maybe
> > > the "right" arrow and have the first history
> > > matching the
> > > letters typed show up.  Subsequent "rights"
> would
> > > cycle through
> > > the other matching history values.
> > > 
> > > Is this possible?
> > > 
> > > TIA,
> > > Nate


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com



More information about the Linux-users mailing list