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.

Is it possible to disable bash's autocomplete on pressing tab?

The reason I want to do this is that I often paste code from an editor where I use the tab character instead of a number of spaces for indention, into my terminal.

And no, you can't convince me to use spaces instead of tabs.

share|improve this question
    
In zsh, the Tab key inserts a tab if you press it at the beginning of a line (before any non-whitespace character). I don't think bash can be programmed for that (you can bind a key to a bash function, but AFAIK you can't trigger a completion from that bash function). –  Gilles Jan 21 '12 at 14:39

2 Answers 2

up vote 6 down vote accepted

put

 set disable-completion on

string in ~/.inputrc and restart your shell. it will disable completion at all.

share|improve this answer
    
not only in bash though... –  yarek Jan 19 '12 at 20:07
5  
To have it only affect Bash, instead of including that line in your ~/.inputrc file, add this to the appropriate shell startup file: bind 'set disable-completion on' –  Dennis Williamson Jan 19 '12 at 20:13
1  
What Dennis said, and the appropriate startup file is ~/.bashrc (if it doesn't take in login shells, add source ~/.bashrc to ~/.bash_profile). –  Gilles Jan 20 '12 at 22:51

To disable Bash tab completion only temporarily you can start a Bash with the --noediting option:

alias noed='bash --noediting'
share|improve this answer

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.