dotfiles/includes/bash_completion.bash
Jacob Kiers fb10240506 Split off bash completion.
Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
2014-06-25 18:10:23 +02:00

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