forked from JoeHCQ1/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bash_aliases.sh
executable file
·93 lines (76 loc) · 1.4 KB
/
bash_aliases.sh
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
#!/bin/bash
alias sl=ls
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias ..="cd .."
alias ...="cd ../../"
alias ....="cd ../../../"
if which vim >>/dev/null
then
alias vi=vim
alias v=vim
fi
if which kubectl >>/dev/null
then
source <(kubectl completion bash)
alias k=kubectl
complete -F __start_kubectl k
fi
if which minikube >>/dev/null
then
alias mk=minikube
fi
if which k9s >>/dev/null
then
alias k9=k9s
fi
if which kubie >>/dev/null
then
alias kx="kubie ctx"
alias ks="kubie ns"
fi
if which helm >>/dev/null
then
alias chart=helm
fi
alias here='echo $PWD'
if which shellcheck >>/dev/null
then
alias shellcheckr="shellcheck \$(find . -type f -name \"*.sh\")"
fi
alias surrender='sudo chown -R $USER:$USER .'
alias refresh="source ~/.bashrc"
if which docker >>/dev/null
then
alias dk="docker"
fi
if which docker-compose >>/dev/null
then
alias dc="docker-compose"
fi
remove_git_submodule ()
{
git submodule deinit -f -- "${1}";
rm -rf .git/modules/"${1}";
git rm -f "${1}"
}
# For use in `git`
isWinDir () {
case $PWD/ in
(/mnt/*) return 0 ;;
(*) return 1 ;;
esac
}
git () {
if isWinDir
then
git.exe "$@"
else
/usr/bin/git "$@"
fi
}
alias gs="git status"
alias gm="git commit"
alias gp="git push"
alias gpf="git push --force"