-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_zshrc
More file actions
52 lines (43 loc) · 1.64 KB
/
dot_zshrc
File metadata and controls
52 lines (43 loc) · 1.64 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
ZSHHOME="${HOME}/.zsh.d"
touch "$ZSHHOME/.profile.zsh"
if [ -f "$HOME/.bash_path" ]; then
. "$HOME/.bash_path"
fi
# brew completions
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh-completions:$FPATH
autoload -Uz compinit
compinit
fi
export FZF_DEFAULT_OPTS='--height 40% --reverse --select-1'
source <(fzf --zsh)
firstInitializeFiles=(
# 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.
"${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
"$(brew --prefix)/share/powerlevel10k/powerlevel10k.zsh-theme"
"$(brew --prefix)/share/zsh-abbr/zsh-abbr.zsh"
"$(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
"$(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
"$ZSHHOME/.default.zsh"
"$ZSHHOME/.profile.zsh"
)
finalInitializeFiles=(
"$ZSHHOME/.bindkey.zsh"
# To customize prompt, run `p10k configure` or edit .p10k.zsh
"$ZSHHOME/.p10k-functions.zsh"
"$ZSHHOME/.p10k.zsh"
)
ignore_files=(${firstInitializeFiles[*]} ${finalInitializeFiles[*]})
initializeFiles=()
while read -d $'\0' file; do
echo ${ignore_files[@]} | xargs -n 1 | grep -E "^$file$" > /dev/null
if [ $? -ne 0 ]; then
[[ ${file##*/} = *.zsh ]] && [ \( -f $file -o -h $file \) -a -r $file ] && initializeFiles+=("$file")
fi
done < <(find -L $ZSHHOME -mindepth 1 -maxdepth 2 -print0)
files=(${firstInitializeFiles[*]} ${initializeFiles[*]} ${finalInitializeFiles[*]})
for i in $files; do
source "$i"
done