-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.shell_aliases
82 lines (69 loc) · 1.81 KB
/
.shell_aliases
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
alias bell='echo -en "\a"'
alias cd..='cd ..'
alias ..='cd ..'
# some more ls aliases
alias ls='ls --color=auto'
alias ll='ls -lh'
alias la='ls -Al'
alias l='ls -ahCF'
# some useful aliases
alias nocomment="grep -Ev '^($|\s*#)'"
alias se='sudo vim'
alias vim='vim'
alias vi='vim'
alias grep='grep --color=auto'
# some colorized commands
if $(which grc &> /dev/null)
then
alias colourify="grc -es --colour=auto"
alias ping='colourify ping'
alias ping6='colourify ping6'
alias make='colourify make'
alias gcc='colourify gcc'
alias g++='colourify g++'
fi
alias ducks='du -cks * | sort -rn'
if $(which xsel &> /dev/null); then
alias pbcopy='xsel -b'
fi
if ! $(which jshon &> /dev/null); then
alias jshon='myjshon'
else
unalias jshon &>/dev/null
fi
if [[ $OSTYPE == darwin* ]]; then
alias flushdns='dscacheutil -flushcache'
# Fix for slow MC start - https://unix.stackexchange.com/questions/57439/slow-start-of-midnight-commander
alias mc="mc --nosubshell"
fi
# Kubernetes
if type kubectl &>/dev/null; then
alias kube='kubectl'
alias k='kubectl'
alias kctx='kubectx'
fi
# GoEnv
if type goenv &>/dev/null; then
export GOENV_ROOT="$HOME/.goenv"
eval "$(goenv init -)"
fi
if type brew &>/dev/null; then
alias brew-upgrade='brew update && brew upgrade && brew cleanup'
fi
# Jenv
if type jenv &>/dev/null; then
export PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"
fi
# pyEnv
if type pyenv &>/dev/null; then
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
fi
if [ -n "$BASH" ]; then
# completion for aliases (use `complete -p command` to resolve completition for command)
complete -o default -o nospace -F __start_kubectl kube
complete -o default -o nospace -F __start_kubectl k
complete -o default -o nospace -F _kube_contexts kctx
fi