This repository has been archived by the owner on Mar 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zshrc
122 lines (90 loc) · 2.83 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
#!/usr/bin/env bash
# Apply colours from pywal
# cat ~/.config/wpg/sequences
# Set basic zsh options
source ~/zsh-scripts/zsh_options.sh
# Initialize zinit/zplugin
source ~/zsh-scripts/init_zinit.sh
# Load keybindings
source ~/zsh-scripts/keybindings.sh
# zinit load "softmoth/zsh-vim-mode"
# source ~/zsh-scripts/vi_keybindings.sh
zinit load "MikeDacre/careful_rm"
# Load asynchronously
zinit wait lucid for \
"MikeDacre/cdbk" \
atload'_flush_ysu_buffer' "MichaelAquilina/zsh-you-should-use" \
atload'_zsh_autosuggest_start' "zsh-users/zsh-autosuggestions" \
atinit'zpcompinit' "zdharma/fast-syntax-highlighting"
zinit snippet OMZ::lib/git.zsh
zinit svn for OMZ::plugins/emacs
omz_plugins=(
archlinux
emacs
git
thefuck
yarn
)
for plugin in ${omz_plugins[@]}; do
zinit snippet OMZ::plugins/$plugin/$plugin.plugin.zsh
done
# Make careful_rm -c default for $HOME
[ ! -f "$HOME/.rm_recycle_home" ] && touch "$HOME/.rm_recycle_home"
# Make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
[ ! -d "$HOME/scripts" ] && mkdir "$HOME/scripts"
[ ! -x "$HOME/scripts/private.sh" ] &&
touch "$HOME/scripts/private.sh" &&
chmod +x "$HOME/scripts/private.sh"
# === Activate scripts === #
scripts=(
# Adds function for checking if given command is available. Required by debian-arch-bridge.sh
~/scripts/cmd_available.sh
# Private things. Don't upload!
~/scripts/private.sh
# Apply fzf shortcuts e.g. M-c — go to file
/usr/share/fzf/completion.zsh
/usr/share/fzf/key-bindings.zsh
# Load aliases (file is compatible with both bash and zsh)
~/.aliases
# Load global aliases
~/zsh-scripts/global_aliases.zsh
# Load the calc plugin
~/zsh-scripts/calc.sh
# Load the zmv command
~/zsh-scripts/zmv.sh
# Make ls colorful
~/zsh-scripts/set_ls_colors.sh
)
for script in ${scripts[@]}; do
# -s: True if file exists and has a size greater than zero.
# Source: https://www.gnu.org/software/bash/manual/html_node/Bash-Conditional-Expressions.html
# if [ -s "$script" ]; then
source "$script"
# fi
done
alias src='source ~/.zshrc'
# Load prompt
AGKOZAK_BLANK_LINES=1
AGKOZAK_LEFT_PROMPT_ONLY=1
AGKOZAK_PROMPT_CHAR=('%F{magenta}❯%f' '%F{red}❯%f' '%F{magenta}❮%f')
zinit load "agkozak/agkozak-zsh-prompt"
# Fuck it
eval "$(thefuck --alias)"
if [ -r ~/.opam/opam-init/init.zsh ]; then
source ~/.opam/opam-init/init.zsh >/dev/null 2>&1
fi
if [ -r ~/.config/broot/launcher/bash/br ]; then
source ~/.config/broot/launcher/bash/br >/dev/null 2>&1
fi
# Init completions
zpcompinit
zinit cdreplay -q
# THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
# Shut up, have you ever programmed in shell?
if [ -d "$HOME/.sdkman" ]; then
export SDKMAN_DIR="$HOME/.sdkman"
if [ -s "$SDKMAN_DIR/bin/sdkman-init.sh" ]; then
source "/home/nawordar/.sdkman/bin/sdkman-init.sh"
fi
fi