-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdot_zshrc
77 lines (60 loc) · 2.38 KB
/
dot_zshrc
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
# read starship prompt config
eval "$(starship init zsh)"
# create 'n' shortcut to open nnn and browse files
source ~/.local/share/zsh/quitcd.bash_zsh
# load compinit (includes git automcompletion)
autoload -Uz compinit && compinit
# load fzf
export FZF_DEFAULT_OPTS='--border'
source /opt/homebrew/Cellar/fzf/*/shell/key-bindings.zsh
source /opt/homebrew/Cellar/fzf/*/shell/completion.zsh
# load kubeone autocomplete
source /opt/homebrew/Cellar/kubeone/*/share/zsh/site-functions/_kubeone
# load fubectl
source ~/.config/zsh/fubectl.source
# editor configuration
export EDITOR=nvim
alias vi=nvim
# configure bat
export BAT_THEME="base16"
# handy aliases
alias cgit="chezmoi git -- "
alias load-env='[ ! -f .env ] || export $(grep -v '^#' .env | xargs)'
alias decode-jwt="jq -R 'split(\".\") | .[0],.[1] | @base64d | fromjson' <<< "
alias prowjobs='kubectl get pods -l created-by-prow=true -o custom-columns=NAME:.metadata.name,ORG:".metadata.labels.prow\.k8s\.io\/refs\.org",REPO:".metadata.labels.prow\.k8s\.io\/refs\.repo",PR:".metadata.labels.prow\.k8s\.io\/refs\.pull",JOB:".metadata.labels.prow\.k8s\.io\/job",TYPE:".metadata.labels.prow\.k8s\.io\/type",STATUS:".status.phase",NODE:".spec.nodeName",CREATED:".metadata.creationTimestamp" --field-selector=status.phase!=Succeeded'
# set some common commands
alias python=python3
alias nerdctl="lima nerdctl"
alias docker="lima nerdctl"
# add various bin locations to PATH
export PATH=$PATH:$HOME/.mix/escripts:$HOME/bin:$HOME/go/bin:$HOME/.cargo/bin
# use homebrew-provided curl and GNU utils
export PATH=/opt/homebrew/opt/curl/bin:$PATH
export PATH=/opt/homebrew/opt/libpq/bin:$PATH
export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"
export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"
# add krew binaries to PATH
export PATH=$PATH:$HOME/.krew/bin
# don't send semgrep metrics
export SEMGREP_SEND_METRICS=off
# set up better history
setopt HIST_IGNORE_ALL_DUPS
setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY
setopt HIST_IGNORE_SPACE
setopt HIST_SAVE_NO_DUPS
setopt HIST_REDUCE_BLANKS
export HISTSIZE=100000
export SAVEHIST=$HISTSIZE
# the ultimate YAML engineer alias
alias k=kubectl
# load kubeconfig-bikeshed shell completion & magic
if command -v kbs &>/dev/null
then
source <(kbs shell completion zsh)
source <(kbs shell magic zsh)
fi
# load snippets from a .zshrcd directory
for file in ~/.zshrcd/*; do
source "$file"
done