-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrc
93 lines (76 loc) · 2.79 KB
/
rc
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
export DOTS=~/dots
export LANG=en_GB.UTF-8
export LC_ALL=en_GB.UTF-8
shell_in_use=$(ps -o args= -p "$$")
if [[ $shell_in_use =~ "zsh" ]]; then
PS1="%1~ $ "
elif [[ $shell_in_use =~ "bash" ]]; then
PS1="\W $ "
fi
# Custom commands
export PATH="${DOTS}/bin:${PATH}"
# Custom sourced commands
for file in "$DOTS/source-bin/"* ; do
if [ -f "$file" ] ; then
# shellcheck disable=SC1090
source "$file"
fi
done
# Make the command line have Vi functionality
# set -o vi
# General Aliases
alias spy='watch ' # Gets watch to support aliases with spy
alias ll='ls -lh'
alias la='ls -lah'
alias pip='python3 -m pip' # Using default Python installation's pip module.
# Git
git config --global core.excludesfile $DOTS/config-files/.gitignore
git config --global core.editor vim
git config --global core.ignorecase true
git config --global gpg.program gpg
git config --global pull.rebase false
git config --global init.defaultBranch main
git config --global push.autoSetupRemote true
export GPG_TTY=$(tty)
if [[ "$(uname)" =~ "Darwin" ]]; then
git config --global credential.helper osxkeychain # Permanent cache
elif [[ "$(uname)" =~ "Linux" ]]; then
git config --global credential.helper 'cache --timeout=86400' # 24 hour cache
fi
# Kubectl
alias k='kubectl'
export PATH="${HOME}/.krew/bin:${PATH}"
alias kx='kubectl ctx'
alias portargo='kubectl -n argocd port-forward svc/argo-cd-argocd-server 9999:80'
export USE_GKE_GCLOUD_AUTH_PLUGIN=True
# Kubectl Krew
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
# Lima VM
if [[ "$(uname)" =~ "Darwin" ]]; then
alias cn='lima nerdctl'
fi
# SDKMAN
export SDKMAN_DIR="${HOME}/.sdkman"
[[ -s "$SDKMAN_DIR/bin/sdkman-init.sh" ]] && source "$SDKMAN_DIR/bin/sdkman-init.sh"
# Google Cloud SDK
export GOOGLE_CLOUD_SDK="${HOME}/google-cloud-sdk"
if [[ $shell_in_use =~ "zsh" ]]; then
if [ -f "$GOOGLE_CLOUD_SDK/path.zsh.inc" ]; then source "$GOOGLE_CLOUD_SDK/path.zsh.inc"; fi
if [ -f "$GOOGLE_CLOUD_SDK/completion.zsh.inc" ]; then source "$GOOGLE_CLOUD_SDK/completion.zsh.inc"; fi
elif [[ $shell_in_use =~ "bash" ]]; then
if [ -f "$GOOGLE_CLOUD_SDK/path.bash.inc" ]; then source "$GOOGLE_CLOUD_SDK/path.bash.inc"; fi
if [ -f "$GOOGLE_CLOUD_SDK/completion.bash.inc" ]; then source "$GOOGLE_CLOUD_SDK/completion.bash.inc"; fi
fi
alias gala='gcloud auth login --update-adc'
# Node Version Manager
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Android SDK & Platform Tools
if [[ "$(uname)" =~ "Darwin" ]]; then
export ANDROID_HOME="$HOME/Library/Android/sdk"
elif [[ "$(uname)" =~ "Linux" ]]; then
export ANDROID_HOME="$HOME/Android/Sdk"
fi
export PATH="$ANDROID_HOME/platform-tools:$PATH"