-
Notifications
You must be signed in to change notification settings - Fork 2
/
zshrc-no-ghr
191 lines (171 loc) · 7.53 KB
/
zshrc-no-ghr
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
# 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
ZINIT_HOME="${ZINIT_HOME:-${ZPLG_HOME:-${ZDOTDIR:-${HOME}}/.zinit}}"
ZINIT_BIN_DIR_NAME="${${ZINIT_BIN_DIR_NAME:-${ZPLG_BIN_DIR_NAME}}:-bin}"
### Added by Zinit's installer
if [[ ! -f "${ZINIT_HOME}/${ZINIT_BIN_DIR_NAME}/zinit.zsh" ]]; then
print -P "%F{33}▓▒░ %F{220}Installing DHARMA Initiative Plugin Manager (zdharma-continuum/zinit)…%f"
command mkdir -p "${ZINIT_HOME}" && command chmod g-rwX "${ZINIT_HOME}"
command git clone https://github.com/zdharma-continuum/zinit "${ZINIT_HOME}/${ZINIT_BIN_DIR_NAME}" && \
print -P "%F{33}▓▒░ %F{34}Installation successful.%f" || \
print -P "%F{160}▓▒░ The clone has failed.%f"
fi
source "${ZINIT_HOME}/${ZINIT_BIN_DIR_NAME}/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
### End of Zinit installer's chunk
# Initialize command prompt
export PS1="%n@%m:%~%# "
# Load local bash/zsh compatible settings
_INIT_SH_NOFUN=1
[ -f "$HOME/.local/etc/init.sh" ] && source "$HOME/.local/etc/init.sh"
[ -f "$HOME/.local/etc/config.zsh" ] && source "$HOME/.local/etc/config.zsh"
[ -f "$HOME/.local/etc/local.zsh" ] && source "$HOME/.local/etc/local.zsh"
[ -f "$HOME/.local/etc/function.sh" ] && . "$HOME/.local/etc/function.sh"
# check login shell
if [[ -o login ]]; then
[ -f "$HOME/.local/etc/login.sh" ] && source "$HOME/.local/etc/login.sh"
[ -f "$HOME/.local/etc/login.zsh" ] && source "$HOME/.local/etc/login.zsh"
fi
# exit for non-interactive shell
[[ $- != *i* ]] && return
# WSL (aka Bash for Windows) doesn't work well with BG_NICE
[ -d "/mnt/c" ] && [[ "$(uname -a)" == *Microsoft* ]] && unsetopt BG_NICE
#### PLUGIN START ####
alias zt='zinit wait lucid depth=3'
### Powerlevel10k
zinit ice depth=1; zinit light romkatv/powerlevel10k
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
### Trigger-load
zinit light-mode for \
trigger-load'!x' blockf \
Asumerodi/omz-extract \
trigger-load'!man' \
ael-code/zsh-colored-man-pages \
trigger-load'!zhooks' \
agkozak/zhooks \
trigger-load'!ccat;!cless' \
OMZP::colorize/colorize.plugin.zsh \
trigger-load'!alias-finder' \
OMZP::alias-finder/alias-finder.plugin.zsh \
trigger-load'!\=' \
arzzen/calc.plugin.zsh \
trigger-load'!cpv' \
OMZP::cp/cp.plugin.zsh
### OMZ basics
zinit light-mode for \
OMZL::completion.zsh \
OMZL::key-bindings.zsh \
OMZL::history.zsh \
atload'export LSCOLORS="ExgxcxdxCxegedabagacad"' \
OMZL::theme-and-appearance.zsh
setopt CORRECT
DISABLE_MAGIC_FUNCTIONS=true
DISABLE_AUTO_TITLE=true
### Important aliases & functions
zinit aliases light-mode for \
OMZL::directories.zsh \
OMZP::common-aliases/common-aliases.plugin.zsh \
blockf atload'export ZSH_TMUX_FIXTERM=false' \
OMZP::tmux/tmux.plugin.zsh
zinit light lljbash/zsh-renew-tmux-env
### Other plugins
zt light-mode for \
atload"_zsh_autosuggest_start" \
zsh-users/zsh-autosuggestions \
OMZP::command-not-found/command-not-found.plugin.zsh \
OMZP::sudo/sudo.plugin.zsh \
atload'ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(autopair-insert)' \
hlissner/zsh-autopair \
atclone'dircolors -b LS_COLORS > lscolors.zsh' atpull'%atclone' \
nocompletions pick'lscolors.zsh' \
trapd00r/LS_COLORS \
pick'autoenv.zsh' nocompletions \
Tarrasch/zsh-autoenv \
blockf \
agkozak/zsh-z
### Aliases
zt aliases light-mode for \
OMZL::git.zsh \
blockf \
OMZP::git/git.plugin.zsh \
OMZP::nmap/nmap.plugin.zsh \
OMZP::rsync/rsync.plugin.zsh \
blockf \
OMZP::ubuntu/ubuntu.plugin.zsh \
'https://github.com/lljbash/configs/blob/master/my_aliases.zsh'
### Applications (binaries maintained by conda-forge now)
zinit light zdharma-continuum/zinit-annex-bin-gem-node
zt as "null" nocompile light-mode for \
atload'export FZF_DEFAULT_COMMAND="fd --type f"; export FZF_BASE=$(pwd)' \
junegunn/fzf
zt as "null" from nocompile light-mode for \
atclone"sed -e '1,/\`\`\`gitconfig/d' -e '/\`\`\`/,\$d' README.md > gitconfig;
git config --global include.path \$(pwd)/gitconfig" \
atpull'%atclone' \
"https://github.com/dandavison/delta/blob/main/README.md"
## With completions
zt as"completion" blockf nocompile light-mode for \
atload"unalias fd &>/dev/null" \
"https://github.com/sharkdp/fd/blob/master/contrib/completion/_fd" \
atload'_lljbash_exa_icons() {
if [[ $POWERLEVEL9K_LEFT_PROMPT_ELEMENTS[(r)os_icon] == os_icon ]]; then
echo "--icons"
fi
}
alias ls='\''exa'\'';
alias l='\''exa -lbF --git $(_lljbash_exa_icons)'\'';
alias ll='\''exa -lbGF --git $(_lljbash_exa_icons)'\'';
alias llm='\''exa -lbGd --git --sort=modified $(_lljbash_exa_icons)'\'';
alias la='\''exa -lbFa --git $(_lljbash_exa_icons)'\'';
alias lx='\''exa -lbhHigUmuSa@ --time-style=long-iso --git \
--color-scale $(_lljbash_exa_icons)'\'';
alias lS='\''exa -1'\'';
alias lt='\''exa -FT $(_lljbash_exa_icons)'\''
alias lta='\''exa -FTa --ignore-glob=.git $(_lljbash_exa_icons)'\''
alias llt='\''exa -lbFT --git $(_lljbash_exa_icons)'\''
alias llta='\''exa -lbFTa --git --ignore-glob=.git $(_lljbash_exa_icons)'\''' \
"https://github.com/ogham/exa/blob/master/completions/zsh/_exa" \
"https://github.com/BurntSushi/ripgrep/blob/12.1.1/complete/_rg" \
mv'just.zsh -> _just' \
"https://github.com/casey/just/blob/v0.9.4/completions/just.zsh" \
atclone"sed -e 's/{{PROJECT_EXECUTABLE}}/bat/g' bat.zsh.in > _bat" atpull'%atclone' \
"https://github.com/sharkdp/bat/blob/master/assets/completions/bat.zsh.in"
## Actually scripts
zt as"null" light-mode nocompile for \
sbin"bin/git-ignore" \
laggardkernel/git-ignore
### Completions
zt light-mode for \
blockf \
OMZP::fzf/fzf.plugin.zsh \
as"completion" blockf \
"https://github.com/jonathanpoelen/dotfiles/blob/master/.zshcompletions/_delta" \
blockf \
zsh-users/zsh-completions \
as"completion" blockf \
conda-incubator/conda-zsh-completion \
atinit'zicompinit; zicdreplay; compdef _delta delta' \
atload"zstyle ':completion:*' fzf-completion-opts --bind=tab:down,btab:up" \
"https://github.com/lincheney/fzf-tab-completion/blob/master/zsh/fzf-zsh-completion.sh"
## use fzf-tab-completion as an alternative due to zsh crashes
## https://github.com/Aloxaf/fzf-tab/issues/176
# blockf compile'lib/*f*~*.zwc' \
# atload'ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(fzf-tab)' \
# Aloxaf/fzf-tab
### Highlighting
zt light-mode for \
atclone'(){local f;cd -q →*;for f (*~*.zwc){zcompile -Uz -- ${f}};}' \
compile'.*fast*~*.zwc' nocompletions atpull'%atclone' \
atload'fast-theme -q clean' \
zdharma-continuum/fast-syntax-highlighting \
### Cleanup
zt as"null" light-mode for \
id-as'Cleanup' nocd atinit'unalias zt &>/dev/null; _zsh_autosuggest_bind_widgets' \
zdharma-continuum/null
#### PLUGIN END ####