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 use a hosts file to block ads/malware domains. When I use ssh or scp in zsh and try to tab-complete, it takes a good 5-10 seconds before anything appears and what does appear is usually a list of 20+ domains I have blocked, and buried in there is the file I need.

I've search online quite a bit, and found helpful hints of how to add this sort of auto-completion, but I can't figure out how to remove it. I basically never want the tab-complete to search my hosts file (I use known-hosts for the servers I actually do want to tab-complete to).

This is on OS X.

share|improve this question

migrated from stackoverflow.com Jun 1 '11 at 13:31

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

1 Answer 1

up vote 4 down vote accepted

Try adding the following to your zshrc

zstyle ':completion:*' hosts off
share|improve this answer
1  
Or zstyle -e ':completion:*' hosts 'reply=($myhosts)' to complete hosts from an array of your choosing (that example is from zshcompsys(1). –  Gilles Jun 1 '11 at 22:22
    
you can also use zstyle -e ':completion:*' hosts /my/special/hostfile –  echox Jun 2 '11 at 10:37
    
Thanks a lot, I have thousands of hosts in my hosts file and it save me a lot of tabs ;) –  Dorian Sep 21 '11 at 9:20

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.