-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_zshrc
More file actions
163 lines (98 loc) · 2.79 KB
/
Copy pathdot_zshrc
File metadata and controls
163 lines (98 loc) · 2.79 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# --- Path / Basics ---
export ZSH="$HOME/.oh-my-zsh"
export EDITOR="nano"
export PAGER="less -R"
export PATH="$HOME/.local/bin:$PATH"
# ----- Oh My Zsh -----
# --- Theme ---
ZSH_THEME=""
# --- Plugins ---
plugins=(
git
)
source "$ZSH/oh-my-zsh.sh"
unset LS_COLORS
# ----- User Plugins -----
# --- Starship ---
eval "$(starship init zsh)"
# --- FZF ---
source /usr/share/fzf/key-bindings.zsh
source /usr/share/fzf/completion.zsh
# --- zsh-completions ---
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' menu select
zstyle ':completion:*:descriptions' format '%F{yellow}%d%f'
zstyle ':completion:*:messages' format '%F{purple}%d%f'
zstyle ':completion:*:warnings' format '%F{red}%d%f'
zstyle ':completion::complete:*' use-cache on
zstyle ':completion::complete:*' cache-path ~/.zcompcache
# --- Suggestions & syntax highlighting ---
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source ~/.zsh/catppuccin_mocha-zsh-syntax-highlighting.zsh
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# --- Zoxide setup ---
eval "$(zoxide init zsh)"
# ----- Terminal Configs -----
# --- History config ---
HISTFILE=~/.histfile
HISTSIZE=100000
SAVEHIST=100000
setopt SHARE_HISTORY
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_VERIFY
setopt EXTENDED_HISTORY
# --- Binding Configs ---
bindkey -e
bindkey '^H' backward-kill-word
# ----- Functions & Aliasing -----
# --- LS ---
alias ls='eza --group-directories-first --icons=always'
alias lsa='eza -la --group-directories-first --icons=always'
alias ll='eza -l --group-directories-first --icons=always'
llt() {
if [[ $1 == "r" ]] then
eza -lT --group-directories-first --icons=always ${2:+$2}
else
eza -lT --group-directories-first --icons=always --level=3 ${1:+$1}
fi
}
# --- BAT ---
cat() {
if [[ $1 == "p" ]]; then
bat --style=plain --paging=never "$2"
else
bat --style=plain "$1"
fi
}
# --- Zoxide ---
alias cd='z'
alias ..='z ..'
# --- Clear ---
# Run Fastfetch after clear unless "clear f"
clear() {
if [[ $1 == "f" ]]; then
command clear
else
command clear
run_fastfetch
fi
}
# ----- Helper Functions -----
# --- Fastfetch ---
# Start fastfetch and optionally load custom config based on environment
run_fastfetch() {
if [[ "$FF_PRESET" == "small-minimal" ]]; then
fastfetch -c ~/.config/fastfetch/small-minimal.jsonc
else
# Changes fastfetch preset based on terminal size
if [ $(tput cols) -ge 106 ] && [ $(tput lines) -ge 22 ]; then
fastfetch
else
fastfetch -c ~/.config/fastfetch/small.jsonc
fi
fi
}
# ----- Runtime Function Calls -----
# --- Run Fastfetch ---
run_fastfetch