• Home

Smart up and down on the command line

07 November 2009 at 11:52

I bet everyone already knows this, but I just learned it and love it:

# put this in ~/.inputrc

# By default up/down are bound to previous-history
# and next-history respectively. The following does the
# same but gives the extra functionality where if you
# type any text (or more accurately, if there is any text
# between the start of the line and the cursor), the subset 
# of the history starting with that text is searched 
# Note to get rid of a line just Ctrl-C

"\e[B": history-search-forward
"\e[A": history-search-backward
 
# Include system wide settings which are ignored
# by default if one has their own .inputrc
$include /etc/inputrc


Comments
Display comments as (Linear | Threaded)

No comments

Add Comment

E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

 
 

Archives

  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • Recent...
  • Older...