Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

$endif

set completion-ignore-case on
export EDITOR="vim"
share|improve this question

1 Answer 1

up vote 3 down vote accepted

/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.

share|improve this answer
    
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

 
discard

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

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