-
Notifications
You must be signed in to change notification settings - Fork 0
/
bashrc.macos
86 lines (67 loc) · 2.47 KB
/
bashrc.macos
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# vim:ft=sh
export PATH=$PATH:/opt/homebrew/bin
# bash completion from homebrew
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
function find {
if [ "$#" -lt 1 ]; then
command find .
else
command find $*
fi
}
# this doesn't seem to work at all but leaving for posterity
# use terminal-notifier instead
function growl() {
local msg="\\e]9;\n\n${*}\\007"
case $TERM in
screen*)
echo "using screen term escape codes"
echo -ne '\eP'${msg}'\e\\' ;;
*)
echo -ne ${msg} ;;
esac
return
}
function notify() {
local tmux_window=$(tmux display -pt $TMUX_PANE '#I')
terminal-notifier -sound Default -subtitle "Window $tmux_window" -message $@
}
PS1='\h:\W$(__git_ps1 "(%s)") \u\$ ' # macosx style with git branch
# macos aliases
alias wgrab="curl --remote-name" # make wgrab cause curl to act like wget
alias gvim="mvim" # mvim is the shell script that ships with MacVim -- gvim is the x11 version
alias tcopy="reattach-to-user-namespace pbcopy"
# MacOSX -> based on BSD
# BSD uses posix coreutils
# you can install coreutils from ports/fink/homebrew and have access to them all
# normal port location /opt/local/libexec/gnubin
# normal brew location /usr/local/opt/coreutils/libexec/gnubin
# or g{old command name}
# gnu aliases
alias ls="gls --color=auto"
alias find="gfind"
alias dircolors="gdircolors"
alias pip="pip2.7"
# color-ls initialization (taken from /etc/profile.d/colorls.sh on linux)
# newer version os osx ls support color via env var
CLICOLOR=1
# need this on mavericks to avoid some clang compiler warnings
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future
COLORS=/etc/DIR_COLORS
[ -e "/etc/DIR_COLORS.$TERM" ] && COLORS="/etc/DIR_COLORS.$TERM"
[ -e "$HOME/.dircolors" ] && COLORS="$HOME/.dircolors"
[ -e "$HOME/.dir_colors" ] && COLORS="$HOME/.dir_colors"
[ -e "$HOME/.dircolors.$TERM" ] && COLORS="$HOME/.dircolors.$TERM"
[ -e "$HOME/.dir_colors.$TERM" ] && COLORS="$HOME/.dir_colors.$TERM"
[ -e "$COLORS" ] || return
eval `dircolors --sh "$COLORS" 2>/dev/null`
PATH=/usr/local/bin:/usr/local/sbin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/opt/grep/libexec/gnubin:$PATH
export PATH
export PATH="/usr/local/opt/curl/bin:$PATH"
# rbenv setup
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
export BASH_SILENCE_DEPRECATION_WARNING=1
# homebrew terraform completion commands
complete -C /opt/homebrew/bin/terraform terraform