-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
147 lines (120 loc) · 5.02 KB
/
.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
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
#################################################
# Custom Prompt #
#################################################
# Enable colors and change prompt:
autoload -U colors && colors
PS1="%B%{$fg[blue]%}%25<…<%~%<< $% %{$reset_color%}%b "
#################################################
# History Settings #
#################################################
# History in cache directory:
HISTSIZE=1000000
SAVEHIST=1000000
HISTFILE=~/.cache/zsh/history
setopt INC_APPEND_HISTORY
setopt HIST_IGNORE_DUPS
#################################################
# Old Config #
#################################################
# Basic auto/tab complete: (All replaced by zsh-autocomplete plugin)
#autoload -U compinit
#zstyle ':completion:*' menu select
#zstyle -e ':completion:*:default' list-colors 'reply=("${PREFIX:+=(#bi)($PREFIX:t)(?)*==34=00}:${(s.:.)LS_COLORS}")';
#zmodload zsh/complist
#compinit
#_comp_options+=(globdots) # Include hidden files.
## vi mode
#bindkey -v
#export KEYTIMEOUT=1
# Use vim keys in tab complete menu:
#bindkey -M menuselect 'h' vi-backward-char
#bindkey -M menuselect 'l' vi-forward-char
#bindkey -v '^?' backward-delete-char
#bindkey -M menuselect 'j' vi-down-line-or-history
#bindkey -M menuselect 'k' vi-up-line-or-history
# Change cursor shape for different vi modes.#
#function zle-keymap-select {
# if [[ ${KEYMAP} == vicmd ]] ||
# [[ $1 = 'block' ]]; then
# echo -ne '\e[1 q'
# elif [[ ${KEYMAP} == main ]] ||
# [[ ${KEYMAP} == viins ]] ||
# [[ ${KEYMAP} = '' ]] ||
# [[ $1 = 'beam' ]]; then
# echo -ne '\e[5 q'
# fi}
#zle -N zle-keymap-select
#zle-line-init() {
# zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
# echo -ne "\e[1 q"
#}
#zle -N zle-line-init
#echo -ne '\e[1 q' # Use beam shape cursor on startup.
# Use beam shape cursor for each new prompt.
#preexec() { echo -ne '\e[1 q' ;}
#################################################
# Aliases #
#################################################
alias \
mdisk="udisksctl mount -b $1" \
mkdir="mkdir -p" \
grep="grep --color=auto" \
diff="diff --color=auto" \
vim="nvim" \
vimdiff="nvim -d" \
ls="ls --color" \
gcl="git clone" \
git-status="find . -maxdepth 1 -mindepth 1 -type d -exec sh -c '(echo {} && cd {} && git status -s && echo)' \;"
xi="doas xbps-install -y" \
xq="xbps-query -Rs" \
xr="doas xbps-remove -Ro" \
rm="rm -i"
# poweroff="systemctl hibernate"
md () {
mkdir -p "$@"
cd "$@"
}
#################################################
# Sourcing Plugins #
#################################################
# Load zsh-syntax-highlighting; should be last.
source ~/.config/zsh/plugins/colored-man-pages/colored-man-pages.plugin.zsh
source ~/.config/zsh/plugins/colorize/colorize.plugin.zsh
#source ~/.config/zsh/plugins/zsh-interactive-cd/zsh-interactive-cd.plugin.zsh
#source ~/.config/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source ~/.config/zsh/plugins/zsh-autocomplete/zsh-autocomplete.plugin.zsh
source ~/.config/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source ~/.config/zsh/plugins/history-substring-search/history-substring-search.zsh
#################################################
# zsh-autocomplete #
#################################################
# no: Tab inserts the top completion.
# yes: Tab first inserts a substring common to all listed completions, if any.
zstyle ':autocomplete:*' insert-unambiguous yes
# complete-word: (Shift-)Tab inserts the top (bottom) completion.
# menu-complete: Press again to cycle to next (previous) completion.
# menu-select: Same as `menu-complete`, but updates selection in menu.
# ⚠️ NOTE: This setting can NOT be changed at runtime.
zstyle ':autocomplete:*' widget-style menu-select
# no: Tab uses Zsh's completion system only.
# yes: Tab first tries Fzf's completion, then falls back to Zsh's.
# ⚠️ NOTE: This setting can NOT be changed at runtime and requires that you
# have installed Fzf's shell extensions.
zstyle ':autocomplete:*' fzf-completion no
zstyle ':autocomplete:*' fzf-completion no
# no: Tab uses Zsh's completion system only.
# yes: Tab first tries Fzf's completion, then falls back to Zsh's.
# ⚠️ NOTE: This setting can NOT be changed at runtime and requires that you
# have installed Fzf's shell extensions.
#################################################
# Misc #
#################################################
# bindings for history-substring-search
# putting them here since zsh-syntax-highlighting
# complained
#bindkey -M vicmd 'k' history-substring-search-up
#bindkey -M vicmd 'j' history-substring-search-down
# Change zsh-syntax-highlighting color
# ZSH_HIGHLIGHT_STYLES[suffix-alias]=fg=blue,underline
# ZSH_HIGHLIGHT_STYLES[precommand]=fg=blue,underline
# ZSH_HIGHLIGHT_STYLES[arg0]=fg=blue