forked from farzadghanei/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_zshrc.tmpl
More file actions
160 lines (135 loc) · 4.13 KB
/
Copy pathdot_zshrc.tmpl
File metadata and controls
160 lines (135 loc) · 4.13 KB
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
149
150
151
152
153
154
155
156
157
158
159
# This file is managed by chezmoi. Do not edit directly.
{{- if eq .chezmoi.os "darwin" }}
# OPENSPEC:START
# OpenSpec shell completions configuration
fpath=("$HOME/.zsh/completions" $fpath)
autoload -Uz compinit
compinit
# OPENSPEC:END
{{- end }}
HISTFILE="$HOME/.zsh_history"
HISTSIZE=10000000
SAVEHIST=10000000
setopt appendhistory
setopt EXTENDED_HISTORY # Write the history file in the ":start:elapsed;command" format.
setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
setopt SHARE_HISTORY # Share history between all sessions.
setopt autocd
{{- if eq .chezmoi.os "darwin" }}
export PATH=$PATH:/usr/local/bin:/usr/local/adyen/bin:$HOME/scripts:$HOME/.local/bin:$HOME/go/bin
{{- else }}
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
export ZSH_THEME="agnoster"
export EDITOR=nvim
export CASE_SENSITIVE="true"
# Infinite history
export HISTSIZE=1000000000
export SAVEHIST=1000000000
export HISTFILE=~/.zsh_history
setopt APPEND_HISTORY
setopt INC_APPEND_HISTORY
setopt HIST_IGNORE_DUPS
setopt HIST_FIND_NO_DUPS
plugins=(
zsh-autosuggestions
taskwarrior
)
if [ -e $ZSH/oh-my-zsh.sh ]; then
source $ZSH/oh-my-zsh.sh
fi
{{- end }}
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
if [ -f ~/.zsh_keys ]; then
. ~/.zsh_keys
fi
{{- if eq .chezmoi.os "darwin" }}
source "$HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh"
eval "$(starship init zsh)"
# Source directory-local aliases (written by .envrc via direnv)
# Uses chpwd so it fires when cd-ing into a dir with .aliases
_chpwd_aliases() { [ -f .aliases ] && source .aliases 2>/dev/null; }
chpwd_functions+=(_chpwd_aliases)
fpath=(~/.zsh/completion $fpath)
autoload -Uz compinit && compinit -i
{{- else }}
# Activate virtualenvwrapper
if [[ $(command -v virtualenvwrapper.sh) ]]; then
source virtualenvwrapper.sh
else
VEW_SCRIPT=$(dpkg -L virtualenvwrapper |& grep -E 'virtualenvwrapper.sh$')
if [ $VEW_SCRIPT ]; then
source $VEW_SCRIPT
fi
fi
# Set keyboard rate and delay
if [[ `command -v xset` && -n $DISPLAY ]]; then
xset r rate 175 45
fi
{{- end }}
# Use fd for fzf
if [ -x /usr/bin/fdfind ]; then
export FZF_DEFAULT_COMMAND='fdfind --hidden --exclude ".git" .';
else
export FZF_DEFAULT_COMMAND='fd --hidden --exclude ".git" .';
fi
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
if [[ `command -v npm` ]]; then
export PATH=$PATH:$(npm root |& grep node_modules)/.bin
fi
{{- if eq .chezmoi.os "linux" }}
if [[ `command -v podman` ]]; then
export DOCKER_HOST="unix://$XDG_RUNTIME_DIR/podman/podman.sock"
else
unset DOCKER_HOST
fi
if [[ `command -v doctl` ]]; then source <(doctl completion zsh); fi
if [[ `command -v kubectl` ]]; then source <(kubectl completion zsh); fi
if [[ `command -v flux` ]]; then source <(flux completion zsh); fi
if [ -f $HOME/kubeconfig ]; then
export KUBECONFIG=$HOME/kubeconfig
elif [ -f $HOME/.kube/config ]; then
export KUBECONFIG=$HOME/.kube/config
fi
{{- end }}
if [[ `command -v direnv` ]]; then eval "$(direnv hook zsh)"; fi
{{- if eq .chezmoi.os "linux" }}
if [ -f /etc/bash_completion.d/complete_alias ]; then
source /etc/bash_completion.d/complete_alias
fi
if [[ `command -v flutter` ]]; then
source <(flutter bash-completion)
fi
{{- end }}
if [[ `command -v op` ]]; then
eval "$(op completion zsh)"; compdef _op op
fi
if [[ `command -v gh` ]]; then
eval "$(gh completion -s zsh)"
fi
if [[ `command -v bd` ]]; then
eval "$(bd completion zsh)"
fi
{{- if eq .chezmoi.os "linux" }}
if [[ `command -v github-copilot-cli` ]]; then
eval "$(github-copilot-cli alias -- '$0')"
fi
if [[ `command -v gem` ]]; then
export GEM_HOME="$(ruby -e 'puts Gem.user_dir')"
export PATH="$PATH:$GEM_HOME/bin"
fi
if [[ `command -v gnome-keyring-daemon` ]]; then
eval $(gnome-keyring-daemon --components=pkcs11,secrets,ssh)
export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/gcr/ssh
fi
[ -f ~/.github_token.txt ] && export GITHUB_TOKEN=$(cat ~/.github_token.txt)
{{- end }}
# Disable terminal beep
unsetopt beep
{{- if eq .chezmoi.os "darwin" }}
# Added by Windsurf
export PATH="$HOME/.codeium/windsurf/bin:$PATH"
{{- else }}
{{- end }}