-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.zshrc
More file actions
145 lines (117 loc) · 4.61 KB
/
Copy path.zshrc
File metadata and controls
145 lines (117 loc) · 4.61 KB
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
#!/usr/bin/env zsh
# Enable check for fastfetch and run it if available in large terminals
# Must run before p10k instant prompt to avoid console output warnings
if [ "$(tput lines)" -ge 25 ] && [ "$(tput cols)" -ge 90 ] && command -v fastfetch >/dev/null; then
fastfetch
# if the terminal is small but fastfetch is available, run with a config for small inputs
elif command -v fastfetch >/dev/null; then
fastfetch -c examples/21.jsonc
fi
# 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
# LOADS USER FUNCTIONS
if [[ -a $HOME/.functions ]]; then
source $HOME/.functions
fi
# LOADS USER ALIASES
if [[ -a $HOME/.aliases ]]; then
source $HOME/.aliases
fi
### 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/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
# Fixing completions
setopt automenu nolistambiguous
zstyle ':completion:*' menu select
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*:*:docker:*' option-stacking yes
zstyle ':completion:*:*:docker-*:*' option-stacking yes
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt autocd beep extendedglob nomatch notify
# The following lines were added by compinstall
zstyle :compinstall filename "$HOME/.zshrc"
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/zinit-annex-rust \
pubnic/z-a-as-monitor \
zdharma-continuum/z-a-patch-dl \
zdharma-continuum/z-a-bin-gem-node
### End of Zinit's installer chunk
# Loads powerlevel10k
zinit ice depth=1; zinit light romkatv/powerlevel10k
# Loads plugins
zinit wait lucid for \
atinit'ZINIT[COMPINIT_OPTS]=-C; zicompinit; zicdreplay' \
zdharma-continuum/fast-syntax-highlighting \
blockf \
atuinsh/atuin \
zsh-users/zsh-completions \
atload'!_zsh_autosuggest_start' \
zsh-users/zsh-autosuggestions \
hlissner/zsh-autopair \
zpm-zsh/colorize \
Tarrasch/zsh-command-not-found \
atload'alias python=python3' amstrad/oh-my-matrix \
reegnz/jq-zsh-plugin \
atload'bindkey "^[[A" history-substring-search-up; bindkey "^[[B" history-substring-search-down;' zsh-users/zsh-history-substring-search \
Tarrasch/zsh-colors \
agkozak/zsh-z \
wfxr/forgit \
matheusml/zsh-ai
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
[ -x "$(command -v direnv)" ] && eval "$(direnv hook zsh)"
# Startup scripts are scripts that are run once when a terminal is opened
# since this is zshrc it will run every time a new shell is opened and it's interactive
# if startupscripts is a dir, run all .sh files in it
if [[ -d $HOME/.startupscripts ]]; then
# subshell so the cd never changes the cwd of the shell being opened
(cd $HOME/.startupscripts && find . -type f -name "*.sh" -perm -u+x -exec {} \;)
# is a regular file
elif [[ -f $HOME/.startupscripts ]]; then
# can be executed
if [[ -x $HOME/.startupscripts ]]; then
bash $HOME/.startupscripts &
fi
fi
if [ -x "$(command -v mise)" ] && [ -f $HOME/.mise_shim ]; then
source $HOME/.mise_shim
fi
# Load local overrides not tracked by git
if [ -f "$HOME/.local_overrides" ]; then
source "$HOME/.local_overrides"
fi
##### OS SPECIFIC CONFIGS #######
# MacOS
if [[ $(uname -s) == "Darwin" ]]; then
bindkey -v
$DOTFILES/specific/darwin/non-stowable/one-time-commands/run-one-time-commands.sh
fi
# Linuxes
if [[ $(uname -s) == "Linux" ]]; then
# Correct control keys on linux
bindkey "^[[3~" delete-char # Delete
bindkey "^[[H" beginning-of-line # Home
bindkey "^[[F" end-of-line # End
fi
################################
fpath+=~/.zfunc
# bun completions
[ -s "/Users/khaosdoctor/.bun/_bun" ] && source "/Users/khaosdoctor/.bun/_bun"