-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_bashrc
executable file
·115 lines (95 loc) · 2.1 KB
/
dot_bashrc
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/ksh
# vim: set ft=sh:
case $- in
*i*) ;;
*) return 0;;
esac
set -o vi
[ -n "$KSH_VERSION" ] && set -o viraw
case $TERM in
screen) export TERM=dtterm ;;
esac
shopt -s checkhash checkjobs autocd histappend
alias hist='history'
alias r='fc -s'
# Launch apps
alias sg='launch /Developer/Applications/SmartGit.app'
alias pl='perl'
alias rk='rake'
alias plcat='plutil -convert xml1 -o -'
# tmux stuff
alias tls='tmux list-sessions'
alias tla='tmux attach'
# Editor stuff
#alias emacs='ec -n'
#alias vi='emacs '
alias vi='vimr '
alias vim='/usr/local/bin/nvim'
alias vit='vimr --nvim -p '
alias vis="vimr --nvim -O "
# File management
if [ -e /usr/local/bin/lsd ]
then
alias ls='lsd'
alias ll='ls -l'
elif [ -e /usr/local/bin/gls ]
then
alias ls='gls --color=auto -hF'
alias ll='gls --color=auto -hFal'
else
alias ls='ls -hF'
alias ll='ls -al'
fi
alias eject='diskutil eject'
. ${HOME}/.chezmoivars
# Archive and Package management
alias z='dtrx '
alias tar='gtar '
alias bb="brew bundle -v --file ${CHEZMOI_SOURCE}/Brewfile"
alias bbe='$EDITOR '${CHEZMOI_SOURCE}'/Brewfile'
alias bu='brew update'
alias bup='brew upgrade && brew cleanup'
alias bd='brew desc'
alias bi='brew info'
alias bh='brew home'
alias bch='brew cask home'
# Program shortcuts
alias xml='/opt/local/bin/xmlstarlet'
alias be='bundle exec '
alias guard='bundle exec guard'
alias vssh='vagrant ssh'
alias d='docker'
alias dc='docker-compose'
alias dx='docker context'
alias vbox='VBoxManage'
alias kp='kitchen'
alias pyr='pipenv run'
alias cm='chezmoi'
alias cme='chezmoi edit'
alias tf='terraform'
alias kc='kubectl'
alias flushdns='sudo discoveryutil udnsflushcaches'
alias sqlplus='rlwrap sqlplus'
# Useful functions
_gitcmd=git
which hub > /dev/null && _gitcmd=hub
if which karn > /dev/null
then
function git {
if [ "$1" != "clone" ]
then
karn update
fi
command $_gitcmd "$@"
}
else
alias git='hub '
fi
function exercism {
local out
readarray -t out < <(command exercism "$@")
printf '%s\n' "${out[@]}"
if [[ $1 == "download" && -d "${out[-1]}" ]]; then
cd "${out[-1]}" || return 1
fi
}