When I add the line export EDITOR=vim into /etc/inputrc and start a new session in BASH, I am unable to press the E key on the keyboard. (Well, I can press it, physically, but nothing shows up in the terminal.) At first I thought I did something to the keyboard, but it works in all the other apps running. The peculiarity only occurs in the newly started BASH session. Furthermore, if I use the insert any string from the clipboard into the terminal, all the E's are ignored. Watch:

ubuntu@ubuntu:~$ xclip -o
cat /etc/inputrc
ubuntu@ubuntu:~$ # I shall pr_ss Shift + Ins now:
ubuntu@ubuntu:~$ cat /tc/inputrc
cat: /tc/inputrc: No such file or directory

No 'e' in etc.

Interestingly, if I type apt-g<Tab>, it completes the command and the 'e' shows up:

ubuntu@ubuntu:~$ apt-g    # before pressing tab
ubuntu@ubuntu:~$ apt-get  # after tab

Finally, This is the last bit of /etc/inputrc:

ubuntu@ubuntu:~$ xclip -o | xargs tail 

# for freebsd console
# "\e[H": beginning-of-line
# "\e[F": end-of-line


set completion-ignore-case on
export EDITOR="vim"

/etc/inputrc is used to customize readline, a system that is used by bash and some other programs to handle keyboard input. You can not define environment variables and do other Bash customization in this file.

Instead use /etc/bash.bashrc if you want to change some Bash settings for all users on your system or .bashrc in a user's home folder if you want to change the settings for just one user.

  • It seems the recommended file in which to add the EDITOR variable is /etc/environment, not bash.bashrc (for system-wide settings at least). But thanks for the clarification anyway. – ladaghini Feb 12 '12 at 17:52

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.