-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zshrc
244 lines (200 loc) · 8.55 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# -*- mode: sh; sh-set-shell: zsh -*-
# vim:ft=zsh
################################################################################
########################## ZSH configuration file ##########################
################################################################################
################################################################################
# Set/unset ZSH options #
################################################################################
setopt INC_APPEND_HISTORY SHARE_HISTORY
setopt APPEND_HISTORY
# unsetopt BG_NICE
setopt CORRECT
setopt EXTENDED_HISTORY
# setopt MENU_COMPLETE
# setopt ALL_EXPORT
setopt RM_STAR_WAIT
setopt notify globdots correct pushdtohome cdablevars autolist
setopt correctall autocd recexact longlistjobs interactivecomments
setopt autoresume histignoredups pushdsilent
setopt autopushd pushdminus extendedglob rcquotes mailwarning
unsetopt bgnice autoparamslash
################################################################################
# Set variables #
################################################################################
export PATH="/usr/local/bin:/usr/local/sbin/:/home/dileep/.local/bin:$PATH"
export TERM=xterm-256color
export EDITOR="lvim"
export USE_EDITOR=$EDITOR
export VISUAL=$EDITOR
export BROWSER=brave
export GIT_PAGER="delta"
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
# Set XDG directories.
export XDG_CONFIG_HOME="${HOME}/.config"
export XDG_DATA_HOME="${HOME}/.local/share"
export XDG_BIN_HOME="${HOME}/.local/bin"
export XDG_LIB_HOME="${HOME}/.local/lib"
export XDG_CACHE_HOME="${HOME}/.cache"
# Hardrives and extensions
export SEAGATE="/media/seagate"
export CRUCIAL="/media/crucial"
# fzf configuration
export FZF_BASE="$HOME/.fzf"
# catppuccin colors for fzf
export FZF_DEFAULT_OPTS="\
--height 40% --reverse --preview 'bat --style=numbers --color=always --line-range :500 {}'\
--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"
# poetry path
export PATH="$HOME/.poetry/bin:$PATH"
# doom path
export PATH="$HOME/.emacs.d/bin:$PATH"
# nnn configuration
export NNN_PLUG="b:bookmarks;c:fzcd;d:diffs;f:finder;i:imgview;m:mimelist;n:nuke;o:fzopen;p:preview-tui;r:renamer;u:getplugs;z:autojump"
export NNN_ARCHIVE="\\.(7z|bz2|gz|tar|tgz|zip)$"
export NNN_COLORS="#d79921"
export NNN_TRASH=1
export NNN_FIFO=/tmp/nnn.fifo
# zk notebook directory
export ZK_NOTEBOOK_DIR="/home/dileep/Documents/Zettelkasten"
################################################################################
# Zinit init #
################################################################################
### Added by Zinit's installer
if [[ ! -f $HOME/.zinit/bin/zinit.zsh ]]; then
print -P "%F{33}▓▒░ %F{220}Installing %F{33}DHARMA%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
command mkdir -p "$HOME/.zinit" && command chmod g-rwX "$HOME/.zinit"
command git clone https://github.com/zdharma-continuum/zinit "$HOME/.zinit/bin" && \
print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \
print -P "%F{160}▓▒░ The clone has failed.%f%b"
fi
source "$HOME/.zinit/bin/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
# Load a few important annexes, without Turbo
# (this is currently required for annexes)
zinit light-mode for \
zdharma-continuum/z-a-rust \
zdharma-continuum/z-a-as-monitor \
zdharma-continuum/z-a-patch-dl \
zdharma-continuum/z-a-bin-gem-node
### End of Zinit's installer chunk
################################################################################
# Prompt #
################################################################################
# Starship prompt installed using pacman
# oh-my-posh prompt installed using AUR
################################################################################
# OMZ libs and plugins #
################################################################################
# NOTE:
# Ohmyzsh plugins and libs are loaded first as some these sets some defaults which are required later on.
# Otherwise something will look messed up
# ie. some settings help zsh-autosuggestions to clear after tab completion
setopt promptsubst
# Git
# Source: https://zdharma-continuum.org/zinit/wiki/Example-Oh-My-Zsh-setup/
zinit wait lucid for \
OMZL::git.zsh \
OMZP::git
# important libraries
zinit lucid for \
OMZL::clipboard.zsh \
OMZL::compfix.zsh \
OMZL::history.zsh \
OMZL::spectrum.zsh
# important plugins
zinit ice depth=1
zinit light jeffreytse/zsh-vi-mode
zinit wait lucid for \
OMZP::asdf \
OMZP::archlinux \
OMZP::copypath \
OMZP::direnv \
OMZP::extract \
OMZP::npm \
OMZP::pipenv \
OMZP::pyenv \
OMZP::python \
OMZP::git-extras \
OMZP::web-search
zinit wait"2" lucid atload"bindkey '^R' fzf-history-widget" for OMZP::fzf
################################################################################
# Other plugins #
################################################################################
# Fast-syntax-highlighting & autosuggestions & completions
# Source: zdharma-continuum/fast-syntax-highlighting
zinit wait lucid for \
atinit"ZINIT[COMPINIT_OPTS]=-C; zpcompinit; zpcdreplay" \
zdharma-continuum/fast-syntax-highlighting \
atload"_zsh_autosuggest_start; bindkey '^ ' autosuggest-accept" \
zsh-users/zsh-autosuggestions \
blockf atpull'zinit creinstall -q .' \
zsh-users/zsh-completions
# Learned command autocompletion
zinit wait lucid for dim-an/cod
# Atuin
zinit wait lucid for ellie/atuin
# forgit
zinit wait"2" lucid for wfxr/forgit
# fast alias-tips
zinit wait lucid from"gh-r" as"program" for sei40kr/fast-alias-tips-bin
zinit wait lucid for sei40kr/zsh-fast-alias-tips
# Automatically switch virtualenvs in pipenv and poetry projects
zinit wait"2" lucid for MichaelAquilina/zsh-autoswitch-virtualenv
################################################################################
# Programs #
################################################################################
# Automatically load env variables based on directory
# LS_COLORS
zinit ice atclone"dircolors -b LS_COLORS > clrs.zsh" \
atpull'%atclone' pick"clrs.zsh" nocompile'!' \
atload'zstyle ":completion:*" list-colors “${(s.:.)LS_COLORS}”'
zinit light trapd00r/LS_COLORS
zinit wait lucid as"completion" for \
https://raw.githubusercontent.com/sharkdp/fd/master/contrib/completion/_fd \
https://raw.githubusercontent.com/BurntSushi/ripgrep/master/complete/_rg \
https://github.com/ogham/exa/blob/master/completions/zsh/_exa
zinit ice as"completion"
zinit snippet /home/dileep/.zfunc/_poetry
# Useful git programs
# Source: https://zdharma-continuum.org/zinit/wiki/For-Syntax/
zinit as"null" wait"2" lucid for \
sbin Fakerr/git-recall \
sbin paulirish/git-open \
sbin paulirish/git-recent \
sbin davidosomething/git-my \
sbin arzzen/git-quick-stats \
make"PREFIX=$ZPFX" tj/git-extras
zinit wait"1" as"program" lucid sbin"*cht.sh -> cht.sh" for "https://cht.sh/:cht.sh"
################################################################################
# Sourcing external files #
################################################################################
# aliases
[ -f ~/.zsh_aliases.zsh ] && source ~/.zsh_aliases.zsh
# functions
[ -f ~/.zsh_functions.zsh ] && source ~/.zsh_functions.zsh
# fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# 1password
export OP_SESSION_my="sRCcrR3P7_ye7JjROaSsF_FDkGhxfiFJaKOloioLkKs"
# This command is meant to be used with your shell's eval function.
# Use `op signin my` to sign in
eval "$(op completion zsh)"
# virtualenv
export WORKON_HOME=$HOME/.virtualenvs
source /usr/bin/virtualenvwrapper.sh
# Pyenv config
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
# Zoxide config
eval "$(zoxide init zsh)"
# Navi shell widget
eval "$(navi widget zsh)"
# starship
eval "$(starship init zsh)"
# # oh-my-posh
# eval "$(oh-my-posh init zsh --config ~/.config/oh-my-posh/theme.json)"