Bash: Remove duplicate SSH autocomplete.
This commit is contained in:
parent
67c61baec4
commit
c1f4d1730e
@ -109,16 +109,10 @@ add-ssh-host() {
|
||||
|
||||
tput bold; ssh -o PasswordAuthentication=no $identifier true && { tput setaf 2; echo "SSH key added."; } || { tput setaf 1; echo "Failure"; }; tput sgr0
|
||||
|
||||
_ssh_load_autocomplete
|
||||
_ssh_reload_autocomplete
|
||||
fi
|
||||
}
|
||||
|
||||
# Adds ~/.ssh/config to the ssh autocomplete
|
||||
_ssh_load_autocomplete() {
|
||||
complete -W "$(awk '/^\s*Host\s*/ { sub(/^\s*Host /, ""); print; }' ~/.ssh/config)" ssh
|
||||
}
|
||||
_ssh_load_autocomplete
|
||||
|
||||
# Upload current directory to special directory on my hosting
|
||||
function yay() {
|
||||
server="locum"
|
||||
|
@ -49,7 +49,10 @@ unset file
|
||||
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
|
||||
_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
|
||||
|
||||
# Nano is default editor
|
||||
export EDITOR='nano'
|
||||
|
Loading…
Reference in New Issue
Block a user