Skip to content
Myr

[completion] Look up on ~/.ssh/config.d/* files when doing ssh host complete (#1420)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Rui Coelho · committed by Junegunn Choi · parent 8cf45a5 · Browse files · 2 files+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+2 added−2 removed

  • other:+2 added−2 removed

2 files+2 added−2 removed

modified:shell/completion.bash+1 added-1 removed
241 unmodified lines
242}243244_fzf_complete_ssh() {245 _fzf_complete '+m' "$@" < <(246 cat <(cat ~/.ssh/config /etc/ssh/ssh_config 2> /dev/null | command grep -i '^host ' | command grep -v '[*?]' | awk '{for (i = 2; i <= NF; i++) print $1 " " $i}') \246 cat <(cat ~/.ssh/config ~/.ssh/config.d/* /etc/ssh/ssh_config 2> /dev/null | command grep -i '^host ' | command grep -v '[*?]' | awk '{for (i = 2; i <= NF; i++) print $1 " " $i}') \247 <(command grep -oE '^[[a-z0-9.,:-]+' ~/.ssh/known_hosts | tr ',' '\n' | tr -d '[' | awk '{ print $1 " " $1 }') \248 <(command grep -v '^\s*\(#\|$\)' /etc/hosts | command grep -Fv '0.0.0.0') |249 awk '{if (length($2) > 0) {print $2}}' | sort -u250 )
86 unmodified lines
modified:shell/completion.zsh+1 added-1 removed