-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc
144 lines (104 loc) · 3.22 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
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
export ZSH="$HOME/.oh-my-zsh"
source "$HOME/.exports"
source "$HOME/.aliases"
source "$HOME/.keyboard"
# path
typeset -U path
path=(~/bin ~/.local/bin ~/.cargo/bin $path[@])
fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src
# oh-my-zsh
zstyle ':omz:update' mode reminder # just remind me to update when it's time
zstyle ':omz:update' frequency 7
plugins=(
colored-man-pages
extract
safe-paste
tmux
git
jira
)
source $ZSH/oh-my-zsh.sh
# global options
HYPHEN_INSENSITIVE="true"
HIST_STAMPS="yyyy-mm-dd"
setopt auto_cd
setopt interactivecomments
setopt append_history
setopt no_match
unsetopt correct
unsetopt correct_all
setopt extended_glob
setopt print_exit_value
setopt COMPLETE_ALIASES
setopt no_list_ambiguous
setopt MENU_COMPLETE
setopt complete_in_word
# sourcing .zshrc.d
zshrcd="$HOME/.zshrc.d"
if [ -d "$zshrcd" ]; then
zfiles=("$zshrcd/"*.zsh)
for zf in $zfiles; do
[ -r $zf ] && . $zf
done
fi
# sourcing local zsh if exists
localzshrcd="$HOME/local/zshrc.d"
if [ -d "$localzshrcd" ]; then
localzfiles=("$localzshrcd/"*.zsh)
for localzf in $localzfiles; do
[ -r $localzf ] && . $localzf
done
fi
# asdf
if [ -f "$HOME/.asdf/asdf.sh" ]; then
. $HOME/.asdf/asdf.sh
fi
fpath=(${ASDF_DIR}/completions $fpath)
if asdf current java > /dev/null 2>&1
then
export JAVA_HOME=$(asdf where java)
fi
# initialize completions
autoload -Uz compinit promptinit
compinit -u
promptinit
zstyle ':completion::complete:*' use-cache on
zstyle ':completion::complete:*' cache-path .zcache
zstyle ':completion:*' menu select
zstyle ':completion:*:cd:*' ignore-parents parent pwd
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' group-name ''
zstyle ':completion:*:git-checkout:*' sort false
zstyle ':completion:*:descriptions' format '[%d]'
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
# fzf
# fzf-tab needs to be loaded after compinit,
# but before plugins which will wrap widgets, such as zsh-autosuggestions
export FZF_DEFAULT_OPTS=" \
--color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8 \
--color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc \
--color=marker:#f5e0dc,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8"
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1 --color=always $realpath'
zstyle ':fzf-tab:*' switch-group ',' '.'
zstyle ':fzf-tab:*' show-group none
zstyle ':fzf-tab:*' single-group header
source $ZSH/custom/plugins/fzf-tab/fzf-tab.zsh
# autosuggestions and syntax highlighting
export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8'
source $ZSH/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source $ZSH/custom/resources/zsh-syntax-highlighting/themes/catppuccin_mocha-zsh-syntax-highlighting.zsh
source $ZSH/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# 1password CLI completions
which op &> /dev/null && eval "$(op completion zsh)" && compdef _op op
# broot
if [ -f "$HOME/.config/broot/launcher/bash/br" ]; then
source "$HOME/.config/broot/launcher/bash/br"
fi
# zoxide
eval "$(zoxide init zsh --cmd cd)"
# atuin history
eval "$(atuin init zsh)"
# navi widget
eval "$(navi widget zsh)"
# prompt
eval "$(starship init zsh)"