-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc.tmpl
148 lines (126 loc) · 4.22 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# if tmux is executable, X is running, and not inside a tmux session, then try to attach.
# if attachment fails, start a new session
#if [ -x "$(command -v tmux)" ] && [ -n "${DISPLAY}" ] && [ "${TERM_PROGRAM}" != "vscode" ]; then
# [ -z "${TMUX}" ] && { tmux attach || tmux; } >/dev/null 2>&1
#fi
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Zshrc
# not running interactively then bail
[[ $- != *i* ]] && return
{{ if eq .chezmoi.os "linux" }}
ZSH=/usr/share/oh-my-zsh
{{ else }}
ZSH=~/.oh-my-zsh
{{ end }}
# shell opts
setopt auto_cd
setopt bang_hist
setopt completealiases
setopt extended_history
setopt hist_ignore_all_dups
setopt hist_find_no_dups
setopt inc_append_history
setopt share_history
function gitclean
{
git fetch -p
for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`;
do
git branch -D $branch
done
}
export GO111MODULE=on
export EDITOR="nvim"
export VISUAL="nvim"
plugins=(
git
sudo
zsh-completions
{{ if eq .chezmoi.os "darwin" }}
nvm
{{ end }}
)
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh-completions:$FPATH
autoload -Uz compinit
compinit
fi
{{ if eq .chezmoi.os "linux" }}
autoload -U compinit && compinit
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
eval "$(zoxide init zsh)"
{{ else }}
source $HOMEBREW_PREFIX/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source $HOMEBREW_PREFIX/share/zsh-autosuggestions/zsh-autosuggestions.zsh
{{ end }}
export GPG_TTY="$(tty)"
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
gpgconf --launch gpg-agent
export ANDROID_HOME="$HOME/Android/Sdk"
export ANDROID_SDK_ROOT="$HOME/Android/Sdk"
export PATH=$ANDROID_SDK_ROOT/tools:$PATH
export PATH=$ANDROID_SDK_ROOT/platform-tools:$PATH
export PATH=$ANDROID_HOME/emulator:$PATH
ZSH_CACHE_DIR=$HOME/.cache/oh-my-zsh
if [[ ! -d $ZSH_CACHE_DIR ]]; then
mkdir $ZSH_CACHE_DIR
fi
{{ if eq .chezmoi.os "linux" }}
source $ZSH/oh-my-zsh.sh
if [ `tput colors` != "256" ]; then
ZSH_THEME="robbyrussell"
else
source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
fi
export CHROME_EXECUTABLE=/usr/bin/google-chrome-stable
export SYSTEMD_EDITOR=nvim
export PIPEWIRE_LATENCY="256/48000"
export PATH=$PATH:$(go env GOPATH)/bin
export GOPATH=$(go env GOPATH)
export PATH="$HOME/.ebcli-virtual-env/executables:$PATH"
export PATH="$PATH:$HOME/.local/bin"
# alias
unalias l
unalias la
unalias ll
unalias ls
unalias lsa
if type clipcat-menu >/dev/null 2>&1; then
alias clipedit=' clipcat-menu --finder=builtin edit'
alias clipdel=' clipcat-menu --finder=builtin remove'
bindkey -s '^\' "^Q clipcat-menu --finder=builtin insert ^J"
bindkey -s '^]' "^Q clipcat-menu --finder=builtin remove ^J"
fi
alias grubup='sudo grub-mkconfig -o /boot/grub/grub.cfg'
alias mirrors='sudo reflector --score 100 --latest 25 --country US --protocol https --sort rate --save /etc/pacman.d/mirrorlist --verbose'
alias update='paru -Syyu --noconfirm'
alias sudo='sudo '
alias youtube-dl='yt-dlp'
eval $(thefuck --alias)
{{ else }}
source $ZSH/oh-my-zsh.sh
if [ `tput colors` != "256" ]; then
ZSH_THEME="robbyrussell"
else
source ~/.powerlevel10k/powerlevel10k.zsh-theme
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
fi
export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
{{ end }}
alias ll='exa -l'
alias ls='exa'
alias cat='bat'
export DYNAMO_ENDPOINT=http://localhost:8000
export PATH="$PATH:$(yarn global bin)"
alias vim='nvim'
[ "$TERM" = "xterm-kitty" ] && alias ssh="kitty +kitten ssh"
[ "$TERM" = "xterm-kitty" ] && alias icat="kitty +kitten icat"