-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zshrc.tmpl
108 lines (94 loc) · 3.53 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
#!/usr/bin/env zsh
# Force en_US.UTF-8 locale
export LC_ALL=en_US.UTF-8
## PATH
PATH="$HOME/.local/bin:$PATH" # User-installed binaries
{{- if (gt (len (glob ".rd/bin")) 0) }}
PATH="$HOME/.rd/bin:$PATH" # Rancher Desktop for Docker management
{{- end }}
{{- if (gt (len (glob "$HOMEBREW_PREFIX/opt/libpq/bin")) 0) }}
PATH="$HOMEBREW_PREFIX/opt/libpq/bin:$PATH" # PostgreSQL
{{- end }}
{{- if (gt (len (glob "${XDG_DATA_HOME:-$HOME/.local/share}/google-cloud-sdk/bin")) 0) }}
PATH="${XDG_DATA_HOME:-$HOME/.local/share}/google-cloud-sdk/bin:$PATH" # Google Cloud SDK
{{- end }}
{{- if (gt (len (glob "$HOME/.local/share/yabridge")) 0) }}
PATH="$HOME/.local/share/yabridge:$PATH" # Yabridge for VST plugins
{{- end }}
export PATH
# Activate mise
source <(mise activate zsh)
{{- if lookPath "fzf" }}
# Integrate fzf
source <(fzf --zsh)
export FZF_COMPLETION_OPTS='--border --info=inline'
export FZF_DEFAULT_OPTS='--height 60% --tmux=center,80% --layout=reverse --border --info=inline'
{{- end }}
## HISTORY
{{- if lookPath "atuin" }}
# Use atuin for history management
source <(atuin init zsh)
{{- else }}
export HISTFILE=~/.zsh_history
export HISTSIZE=500000
export SAVEHIST=500000
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 HIST_FIND_NO_DUPS # Do not display a line previously found.
setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history file.
setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry.
{{- end }}
## COMPLETIONS
zstyle ':completion:*' menu yes select
zstyle ':completion:*' format $'\e[2;37mCompleting %d\e[m'
{{- if lookPath "eza" }}
# eza styles https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/eza#configuration
zstyle ':omz:plugins:eza' 'dirs-first' 'yes'
zstyle ':omz:plugins:eza' 'git-status' 'yes'
zstyle ':omz:plugins:eza' 'header' 'yes'
zstyle ':omz:plugins:eza' 'show-group' 'yes'
zstyle ':omz:plugins:eza' 'icons' 'yes'
zstyle ':omz:plugins:eza' 'size-prefix' 'si'
zstyle ':omz:plugins:eza' 'time-style' 'long-iso'
zstyle ':omz:plugins:eza' 'hyperlink' 'yes'
{{- end }}
# Configure builtin completions
zmodload -a colors
zmodload -a autocomplete
zmodload -a complist
autoload -Uz compinit && compinit
{{- if lookPath "carapace" }}
# Load carapace completions
# It includes completions for: aws, gcloud, docker, git, kubectl, terraform, and more
source <(carapace _carapace)
{{- end }}
{{- if lookPath "op" }}
# Load op completions
source <(op completion zsh)
{{- end }}
{{- if lookPath "starship" }}
# Load starship prompt
source <(starship init zsh)
{{- end }}
# Load antidote plugin manager
source "$HOMEBREW_PREFIX/opt/antidote/share/antidote/antidote.zsh"
# initialize plugins statically with ${ZDOTDIR:-~}/.zsh_plugins.txt
antidote load
{{- if eq .chezmoi.os "darwin" }}
## MacOS-specific fixes
# Erlang install fixes
UNIXODBCHOME="$HOMEBREW_PREFIX/opt/unixodbc"
export CPPFLAGS="${CPPFLAGS+"$CPPFLAGS "}-I${UNIXODBCHOME}/include"
export LDFLAGS="${LDFLAGS+"$LDFLAGS "}-L${UNIXODBCHOME}/lib"
export KERL_CONFIGURE_OPTIONS="--with-odbc=${UNIXODBCHOME}"
{{- end }}
{{- if (gt (len (glob ".config/op/plugins.sh")) 0) }}
source $HOME/.config/op/plugins.sh
{{- end }}
# Set up aliases
[[ $- == *i* ]] && source $HOME/.config/zsh/aliases.zsh
{{- if (gt (len (glob ".config/zsh/.zshrc.local")) 0) }}
# Per-machine configuration
source $HOME/.config/zsh/.zshrc.local
{{- end }}