Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I bound some keys by mistake, and they don't work any more, such as HOME, END, UP, DOWN, LEFT, RIGHT.

Is there a way to reset all the bound keys to their original state?

share|improve this question

migrated from stackoverflow.com Sep 20 '11 at 10:52

This question came from our site for professional and enthusiast programmers.

1  
Its usually defined in your .inputrc. –  Lynch Sep 20 '11 at 3:31
    
there is nothing in my .inputrc, and /etc/inputrc only defines some of them. So i wonder where all these r defined? –  LarryLv Sep 20 '11 at 4:00

3 Answers 3

If it's bash that you misconfigured, you might have done so either in ~/inputrc or in ~/.bashrc. ~/.inputrc is the configuration file for the readline library, which is used by bash and a few other command-line programs to read input. ~/.bashrc is the configuration file of bash itself.

If you start a shell with bash --norc, your ~/.bashrc isn't read, but your ~/.inputrc is. If you start a shell with HOME=/none bash, neither file is read, nor your previous shell history.

share|improve this answer

Try xmodmap; the following command will show you the current key bindings:

xmodmap -pke

share|improve this answer
    
xmodmap has a vastly different function than the one being referred to in the question. –  Chris Down Sep 21 '11 at 0:51
    
It's far too vague to say that. Thanks anyway. –  rjp Sep 21 '11 at 3:56
    
I just reread the question and yes, you're correct (I misread the question). But: if it's not readline bash key bindings causing this, xmodmap is a reasonable place to look. Thanks. –  rjp Sep 21 '11 at 4:05

You can reset bash key bindings to their original state: set -o emacs

This sets all key bindings to the default (which is emacs key bindings). Alternatively, if you prefer, you can do: set -o vi

You can also use bind -r <keycode> to remove a single key binding.

More details can be found in the bash man page under "SHELL BUILTIN COMMANDS", then look for "set" and also "bind".

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.