Feature request: Zsh completion for stormssh
gsusrafael opened this issue · 4 comments
gsusrafael commented
Could it be possible to have some completion for Stormssh in ZSH?
SteveClement commented
Here is a bash completion repo, for your reference
hxsf commented
add this code to you .zshrc
h=()
# add you storm config
if [[ -r ~/.ssh/config ]]; then
h=($h ${${${(@M)${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*})
fi
# add you known host
if [[ -r ~/.ssh/known_hosts ]]; then
h=($h ${${${(f)"$(cat ~/.ssh/known_hosts{,2} || true)"}%%\ *}%%,*}) 2>/dev/null
fi
if [[ $#h -gt 0 ]]; then
zstyle ':completion:*:ssh:*' hosts $h
zstyle ':completion:*:slogin:*' hosts $h
fi