-
Notifications
You must be signed in to change notification settings - Fork 2
/
.bash_profile
56 lines (46 loc) · 1.88 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
source ~/.bashrc
# bash copmletions for asdf
if [ -f "$HOME/.asdf/completions/asdf.bash" ]; then
source "$HOME/.asdf/completions/asdf.bash"
fi
# bash completion from Homebrew
if [ -d "/usr/local/etc/bash_completion.d" ]; then
if [ -f "/usr/local/etc/bash_completion.d/git-completion.bash" ]; then source "/usr/local/etc/bash_completion.d/git-completion.bash"; fi
if [ -f "/usr/local/etc/bash_completion.d/git-flow-completion.bash" ]; then source "/usr/local/etc/bash_completion.d/git-flow-completion.bash"; fi
if [ -f "/usr/local/etc/bash_completion.d/git-prompt.sh" ]; then source "/usr/local/etc/bash_completion.d/git-prompt.sh"; fi
if [ -f "/usr/local/etc/bash_completion.d/cargo" ]; then source "/usr/local/etc/bash_completion.d/cargo"; fi
fi
# bash completion for SSH
if [ $(uname) == "Darwin" ]; then
if [ -f $HOME/.ssh/config ]; then
complete -o default -o nospace -W "$(/usr/bin/env ruby -ne 'puts $_.split(/[,\s]+/)[1..-1].reject{|host| host.match(/\*|\?/)} if $_.match(/^\s*Host\s+/);' < $HOME/.ssh/config)" scp sftp ssh
fi
fi
RED='\[\033[1;31m\]'
GREEN='\[\033[1;32m\]'
YELLOW='\[\033[1;33m\]'
BLUE='\[\033[1;34m\]'
DEFAULT='\[\033[0m\]'
function __conditional_git_ps1 {
(command -v __git_ps1 > /dev/null) && __git_ps1
}
export PS1="${GREEN}\h${DEFAULT}:${BLUE}\W${YELLOW}\$(__conditional_git_ps1)${DEFAULT} \$ "
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
export EDITOR=vim
export PAGER=less
if [ "$(uname)" == "Linux" ]
then
alias open='gnome-open'
alias pbcopy='xsel --clipboard --input'
alias pbpaste='xsel --clipboard --output'
fi
# Make use of keychain (if installed) to manage ssh-agent and gpg-agent
if command -v keychain > /dev/null 2>&1 ; then
eval `keychain --eval`
fi
# load settings specific to the local machine
if [ -f ~/.bash_local ]; then
source ~/.bash_local
fi
export PATH