-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zprofile
93 lines (74 loc) · 3.11 KB
/
.zprofile
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
# Used to automatically start the ssh-agent when a terminal loads
env=~/.ssh/agent.env
# Load ssh-agent environment variables
agent_load_env() {
test -f "$env" && . "$env" >| /dev/null ;
}
# Actually start the ssh-agent
agent_start () {
(umask 077; ssh-agent >| "$env")
. "$env" >| /dev/null ;
}
agent_load_env
# agent_run_state: 0=agent running w/ key; 1=agent w/o key; 2= agent not running
agent_run_state=$(ssh-add -l >| /dev/null 2>&1; echo $?)
if [ ! "$SSH_AUTH_SOCK" ] || [ "$agent_run_state" = 2 ]; then
agent_start
fi
# Note: This will print something that looks like an error if no `rsa` or `ed25519` keys are found.
# It doesn't stop execution of this file, unless you `set -e`.
ssh-add ~/.ssh/*_rsa
# ssh-add ~/.ssh/*_ed25519
# Source credentials
source ~/.creds.d/.github
unset env
# Git stuff from @jsleeper; if it breaks call him
alias ga='git add'
alias gb='git branch'
alias gbd='git branch -D'
alias gcan='git commit --amend --no-edit'
alias gcl='git clean -ffxd'
alias gcm='git commit --message'
alias gco='git checkout'
alias gcob='git checkout -b'
alias gd='git diff --ws-error-highlight=all'
alias gdc='git diff --ws-error-highlight=all --cached'
alias gdcp='git diff --patience --ws-error-highlight=all --cached'
alias gdp='git diff --patience --ws-error-highlight=all'
alias gf='git fetch --prune'
alias gfp='git fetch --prune && git pull --rebase --autostash'
alias glg='git log --oneline --graph --all --decorate'
alias gp='git push --set-upstream origin HEAD'
alias grh='git reset --hard @{u}'
alias gs='git status'
# General aliasses
alias repos='cd ~/Documents/repos'
alias reload='omz reload'
function cdl () { cd "$@" && ls; }
function mkcd () { mkdir -p "$@" && eval cd "\"\$$#\""; }
function rename () { for i in $1*; do mv "$i" "${i/$1/$2}"; done; }
function rmia () { docker images | grep "$1" | tr -s ' ' | cut -d ' ' -f 2 | xargs -I {} docker rmi "$1":{} }
function set_aws_credentials {
export AWS_ACCESS_KEY_ID=$(cat ~/.aws/credentials | grep aws_access_key_id | awk '{ print $3 }')
export AWS_SECRET_ACCESS_KEY=$(cat ~/.aws/credentials | grep aws_secret_access_key | awk '{ print $3 }')
}
function unset_aws_credentials { unset AWS_ACCESS_KEY_ID; unset AWS_SECRET_ACCESS_KEY }
# Add Visual Studio Code (code) to $PATH
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
# Load the fuck
# Docs: https://github.com/nvbn/thefuck#installation
# Removed on 8/12/21 because `thefuck` depends on a custom python install which overrides pyenv installs
# eval $(thefuck --alias)
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
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init --path)"
fi
# Created by `pipx` on 2021-04-20 17:21:48
export PATH="$PATH:/Users/sgomena/.local/bin"
# Set up kubectl alias and completions
alias k=kubectl
complete -F __start_kubectl k
# alias trim_path='$PATH=$(python -c "from os import environ; \":\".join(set(environ.get("PATH").split(\":\")))"'
alias cst=$(which container-structure-test)