mirror of
https://github.com/wahyd4/dotfiles.git
synced 2026-08-09 04:46:12 +10:00
.bash_profile: Support hostname aliases defined in ~/.ssh/config
`~/.ssh/config` allows for the usage of hostname aliases, formatted as follows:
Host first_alias second_alias third_alias
HostName foo.example.com
This change makes sure these aliases are parsed out individually and added to the autocomplete list.
Ref. #178.
This commit is contained in:
committed by
Mathias Bynens
parent
2e08075960
commit
969c95bfe9
+1
-1
@@ -26,7 +26,7 @@ for option in autocd globstar; do
|
||||
done
|
||||
|
||||
# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards
|
||||
[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2)" scp sftp ssh
|
||||
[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2 | tr ' ' '\n')" scp sftp ssh
|
||||
|
||||
# Add tab completion for `defaults read|write NSGlobalDomain`
|
||||
# You could just use `-g` instead, but I like being explicit
|
||||
|
||||
Reference in New Issue
Block a user