From ef40eff49121a0182c4746846481d003fc63252c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20P=C5=82azie=C5=84ski?= Date: Mon, 4 Jan 2016 12:20:21 +0100 Subject: [PATCH] cleaned ssh completion --- .zshrc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.zshrc b/.zshrc index 21da07c..52440fc 100644 --- a/.zshrc +++ b/.zshrc @@ -92,6 +92,10 @@ zstyle ':completion:*' squeeze-slashes true zstyle ':completion::*:kill:*:*' command 'ps xf -U $USER -o pid,%cpu,cmd' zstyle ':completion::*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;32' +zstyle ':completion:*:ssh:*' hosts ${${${(@M)${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*} +zstyle ':completion:*:slogin:*' hosts ${${${(@M)${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*} +zstyle ':completion:*:ssh:*' users # disables users completion + zstyle :compinstall filename "$HOME/.zshrc" # Always do mid-word tab completion @@ -470,6 +474,8 @@ sshc() { ssh -q -o "ControlPath=/tmp/.cm-%r@%h:%p" -O stop $1 } +compdef '_dispatch ssh ssh' sshc + #---------------------------------- Miscellaneous ---------------------------- setopt extended_glob