Ignore hosts file in ZSH ssh/scp tab-complete

hostszsh

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.

Best Answer

Try adding the following to your zshrc

zstyle ':completion:*' hosts off
Related Question