-
Notifications
You must be signed in to change notification settings - Fork 0
/
bash_profile
58 lines (49 loc) · 1.34 KB
/
bash_profile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
if [ -f ~/.bash_prompt ]; then
. ~/.bash_prompt
fi
if [ -f /usr/local/bin/virtualenvwrapper.sh ]; then
. /usr/local/bin/virtualenvwrapper.sh
fi
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
if [ -f "$(which git)" ] && [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
if [ -f /usr/bin/vim ]; then
export EDITOR=vim
fi
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
export HISTFILESIZE=200000
export HISTSIZE=10000
shopt -s histappend
shopt -s cmdhist
export HISTCONTROL=ignoreboth
export HISTIGNORE="&:ls:[bf]g:exit"
if [ -f ~/.common_shell_functions ]; then
. ~/.common_shell_functions
fi
#Enable ~/.ssh/config host tab completion
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" ;
cat ~/.ssh/config | \
grep "^Host " | \
awk '{print $2}'
`
COMPREPLY=( $(compgen -W "${comp_ssh_hosts}" -- $cur))
return 0
}
complete -F _complete_ssh_hosts ssh
complete -F _complete_ssh_hosts scp