15 lines
672 B
Bash
15 lines
672 B
Bash
# If possible, add tab completion for many commands
|
|
[ -f /etc/bash_completion ] && source /etc/bash_completion
|
|
|
|
# Bash completion (installed via Homebrew; source after `brew` is added to PATH)
|
|
command -v brew >/dev/null 2>&1 && [ -r "$(brew --prefix)/etc/bash_completion" ] && source "$(brew --prefix)/etc/bash_completion"
|
|
|
|
# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards
|
|
function _ssh_reload_autocomplete() {
|
|
[ -e "~/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2)" scp sftp ssh
|
|
}
|
|
_ssh_reload_autocomplete
|
|
|
|
# Add AWS CLI Completion.
|
|
complete -C aws_completer aws
|