Skip to content

Instantly share code, notes, and snippets.

@gamesguru
Created March 5, 2021 19:53
Show Gist options
  • Save gamesguru/ad6ffec77037783891e62c6936e75a7b to your computer and use it in GitHub Desktop.
Save gamesguru/ad6ffec77037783891e62c6936e75a7b to your computer and use it in GitHub Desktop.
bash profile (macOS)
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
[[ -r "/usr/local/etc/bash_completion.d/python-argcomplete" ]] && . "/usr/local/etc/bash_completion.d/python-argcomplete"
_ssh()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts=$(grep '^Host' ~/.ssh/config ~/.ssh/config.d/* 2>/dev/null | grep -v '[?*]' | cut -d ' ' -f 2-)
COMPREPLY=( $(compgen -W "$opts" -- ${cur}) )
return 0
}
complete -F _ssh ssh
export GPG_TTY=$(tty)
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
#export LSCOLORS=ExGxFxdxCxDxDxxbaDecac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment