-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zshrc
173 lines (144 loc) · 4.8 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
[[ -v ZPROF ]] && zmodload zsh/zprof;
# 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
# Fig
[[ -f "$HOME/.fig/shell/zshrc.pre.zsh" ]] && . "$HOME/.fig/shell/zshrc.pre.zsh"
if [[ -d "~/.zinit/zmodules/Src" ]]; then
module_path+=( "$HOME/.zinit/zmodules/Src" )
zmodload zdharma/zplugin
fi
# PATH Configure
export PATH="$HOME/.local/bin:$HOME/bin:$PATH"
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=10000
setopt autocd extendedglob nomatch notify appendhistory
bindkey -v
# End of lines configured by zsh-newuser-install
source ~/.zinit/zinit.zsh
# Brew Shellenv
if (( $+commands[brew] )); then
export HOMEBREW_NO_GOOGLE_ANALYTICS=false
eval "$(brew shellenv)"
fpath+="/opt/homebrew/share/zsh/site-functions"
fi
# The following lines were added by compinstall
zstyle :compinstall filename '~/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
# Zinit plugins
zinit ice depth=1; zinit light romkatv/powerlevel10k
zinit light zdharma-continuum/fast-syntax-highlighting
if (( $+commands[atuin] )); then
zinit light atuinsh/atuin
else
(( $+commands[fzf] )) && zinit ice lucid wait; zinit light joshskidmore/zsh-fzf-history-search
zinit ice depth=1 wait lucid; zinit light zsh-users/zsh-history-substring-search
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
fi
zinit light zsh-users/zsh-completions
zinit light zsh-users/zsh-autosuggestions
zinit ice lucid wait; zinit light simnalamburt/cgitc
zinit ice lucid pick"z.sh"; zinit light rupa/z
if (( $+commands[fzf] )); then
zinit ice lucid wait pick"fz.sh"; zinit light changyuheng/fz
[ -s ~/.fig/fig.sh ] || zinit ice lucid wait; zinit light Aloxaf/fzf-tab
fi
# history-substring-search
bindkey '^H' backward-kill-word
setopt complete_in_word
setopt always_to_end
WORDCHARS=''
zmodload -i zsh/complist
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# Zsh Fast Syntax Highlighting
fast-theme XDG:catppuccin-macchiato > /dev/null
# Fix keybindings
bindkey "^[[H" beginning-of-line # Home
bindkey "^[[F" end-of-line # End
bindkey "^[[3~" delete-char # Delete
bindkey "^[[1;5C" forward-word # Ctrl + ->
bindkey "^[[1;5D" backward-word # Ctrl + <-
# Set EDITOR
if [[ "$TERM_PROGRAM" = "vscode" ]]; then
export EDITOR="code --wait"
elif [[ -n "$ZED" ]]; then
export EDITOR="zed -w"
elif (( $+commands[nvim] )); then
export EDITOR=nvim
alias lvim="NVIM_APPNAME=lazyvim nvim"
elif (( $+commands[vim] )); then
export EDITOR=vim
fi
# Supercharged default commands.
if (( $+commands[lsd] )); then
alias l='lsd -Al --date=relative --group-dirs=first --blocks=permission,user,size,date,name'
alias ll='lsd -l --date=relative --group-dirs=first --blocks=permission,user,size,date,name'
alias lt='lsd --tree --depth=2 --date=relative --group-dirs=first'
else
alias l='ls -alh'
alias ll='ls -lh'
fi
alias mv='mv -i'
alias cp='cp -i'
alias y='yarn'
alias pick='pushd $(fd -td | fzf)'
# Chezmoi completions
if (( $+commands[chezmoi] )); then
source <(chezmoi completion zsh)
fi
# direnv integration
if (( $+commands[direnv] )); then
eval "$(direnv hook zsh)"
fi
# sccache integration
if (( $+commands[sccache] )); then
export RUSTC_WRAPPER="$(which sccache)"
fi
# fzf integration
if (( $+commands[fzf] )); then
# https://github.com/catppuccin/fzf?tab=readme-ov-file#usage
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"
fi
if (( $+commands[lazygit] )); then
alias lg=lazygit
fi
# iTerm2 integrations
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
# Bun completions
[ -s "~/.bun/_bun" ] && source "~/.bun/_bun"
# Bun
export BUN_INSTALL="~/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
# Volta
if [[ -d "$HOME/.volta" ]]; then
export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"
fi
if [[ -d "$HOME/.cargo" ]]; then
source "$HOME/.cargo/env"
fi
if [[ -d "$HOME/.dotnet/tools" ]]; then
export PATH="$HOME/.dotnet/tools:$PATH"
fi
if (( $+commands[mise] )); then
if [[ -v RTX_SHIM ]]; then
export PATH="$HOME/.local/share/mise/shims:$PATH"
else
eval "$(mise activate zsh)"
fi
fi
[[ -f "$HOME/.fig/shell/zshrc.post.zsh" ]] && . "$HOME/.fig/shell/zshrc.post.zsh"
[[ -v ZPROF ]] && zprof
# vim: ft=zsh