-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc.tmpl
125 lines (94 loc) · 2.69 KB
/
dot_zshrc.tmpl
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# vim: ft=zsh
# If not running interactively, do nothing
[[ $- != *i* ]] && return
export XDG_CONFIG_HOME="$HOME/.config"
export PATH="$HOME/.local/bin:$PATH"
export ZSH=$HOME/.oh-my-zsh
ZSH_THEME="robbyrussell"
HYPHEN_INSENSITIVE=true
ENABLE_CORRECTION=true
COMPLETION_WAITING_DOTS=true
DISABLE_AUTO_UPDATE=true
HIST_STAMPS="yyyy-mm-dd"
# needs to run before initializing plugins
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
export JAVA_HOME="/opt/homebrew/opt/openjdk/"
plugins=(
colored-man-pages
direnv
docker
docker-compose
git
git-extras
kubectl
nvm
pyenv
sudo
terraform
# must be last
zsh-syntax-highlighting
)
source $ZSH/oh-my-zsh.sh
{{ if .work }}
PROMPT+='$(tf_prompt_info) '
ZSH_THEME_TF_PROMPT_PREFIX="%{$fg[magenta]%}"
ZSH_THEME_TF_PROMPT_SUFFIX="%{$reset_color%}"
{{ end -}}
export HISTCONTROL=ignoreboth
export HISTSIZE=10000
export HISTFILESIZE=$HISTSIZE
export LANG="en_US.UTF-8"
export LC_ALL=$LANG
export EDITOR=nvim
export GIT_EDITOR=$EDITOR
unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
fi
export GPG_TTY=$(tty)
gpg-connect-agent updatestartuptty /bye >/dev/null
unsetopt correct_all
alias c="clear"
alias claer="clear"
alias vim="nvim"
alias sudo="sudo "
alias weather="curl wttr.in"
alias notes="cd $HOME/Nextcloud/documents/garden/"
alias lg="lazygit"
alias find_git_changes="find . -type d -iname '.git' -exec sh -c 'cd \${0}/../ && (git status | grep -q \"is ahead of\" || test -n \"\`git status -s\`\") && pwd' '{}' \;"
alias cat="bat"
if command -v eza >/dev/null; then
alias ls='eza-wrapper.sh'
else
alias ls='/bin/ls $LS_OPTIONS'
fi
{{- if eq .chezmoi.os "darwin" }}
export HOMEBREW_CASK_OPTS="--appdir=/Applications"
alias yt-dl-mp3="yt-dlp -o '%(title)s.%(ext)s' -x --audio-format mp3 --audio-quality 320K"
alias yt-dl-mp4="yt-dlp -o '%(title)s.%(ext)s' -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' --merge-output-format mp4"
alias heic-to-jpg="magick mogrify -monitor -format jpg"
cdf() {
cd "$(osascript -e 'tell app "Finder" to POSIX path of (insertion location as alias)')";
}
{{ end -}}
{{- if .work }}
alias awsume=". awsume"
alias combine_dependabot="gh combine-prs --query \"author:app/dependabot\""
{{ end -}}
__update_log() {
printf "\n 📦 \e[92mUpdating $1\e[0m\n"
}
update() {
{{- if eq .chezmoi.os "darwin" }}
__update_log 'macos'
__update_log 'system packages'
sudo softwareupdate -i -a || exit
__update_log 'brew'
brew update
brew upgrade
brew cleanup --prune=all -s
rm -rf $(brew --cache)
{{ end -}}
}