Skip to content

Commit bf2bc31

Browse files
committed
Updated root zshrc based updation of home zshrc
1 parent e01f2e1 commit bf2bc31

File tree

1 file changed

+55
-74
lines changed

1 file changed

+55
-74
lines changed

airootfs/root/.zshrc

Lines changed: 55 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
[[ $- != *i* ]] && return
33

44
alias ls='ls --color=auto'
5+
alias ll='ls --color=auto -lah'
6+
alias grep='grep -n --color'
57
PS1='[\u@\h \W]\$ '
68

79
# Autosuggestions
810
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
911

1012
# synatx-highlighting
1113
source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
12-
#source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
13-
1414

1515
#Display ISO version and distribution information in short
1616
alias version="sed -n 1p /etc/os-release && sed -n 7p /etc/os-release && sed -n 8p /etc/os-release"
@@ -28,14 +28,9 @@ alias unlock="sudo rm /var/lib/pacman/db.lck"
2828
alias remove="sudo pacman -R"
2929
alias autoremove="sudo pacman -Rns"
3030

31-
# Fix keyring and gnupg mount isuue
31+
# Fix keyring and gnupg mount isuue
3232
alias fix-keys="sudo rm -rvf /etc/pacman.d/gnupg && sudo pacman-key --init && sudo pacman-key --populate"
3333

34-
# keyboard ctrl+arrow key issue solved
35-
#bindkey '^[[1;5C' forward-word # Ctrl+Right arrow
36-
#bindkey '^[[1;5D' backward-word # Ctrl+Left arrow
37-
38-
3934
## Path section
4035
# Set $PATH if ~/.local/bin exist
4136
if [ -d "$HOME/.local/bin" ]; then
@@ -51,7 +46,6 @@ precmd_functions+=(set_win_title)
5146
## Plugins section: Enable fish style features
5247
# Use syntax highlighting
5348
source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
54-
#source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
5549

5650
# Use autosuggestion
5751
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
@@ -70,7 +64,6 @@ source /usr/share/fzf/completion.zsh
7064
# Advanced command-not-found hook
7165
[[ -e /usr/share/doc/find-the-command/ftc.zsh ]] && source /usr/share/doc/find-the-command/ftc.zsh
7266

73-
7467
## Options section
7568
setopt correct # Auto correct mistakes
7669
setopt extendedglob # Extended globbing. Allows using regular expressions with *
@@ -90,7 +83,7 @@ setopt pushdminus
9083
autoload -Uz compinit
9184
compinit
9285
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' # Case insensitive tab completion
93-
zstyle ':completion:*' rehash true # automatically find new executables in path
86+
zstyle ':completion:*' rehash true # automatically find new executables in path
9487
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" # Colored completion (different colors for dirs/files/etc)
9588
zstyle ':completion:*' completer _expand _complete _ignored _approximate
9689
zstyle ':completion:*' menu select
@@ -109,66 +102,64 @@ HISTFILE=~/.zhistory
109102
HISTSIZE=50000
110103
SAVEHIST=10000
111104

112-
113105
## Keys
114106
# Use emacs key bindings
115107
bindkey -e
116108

117109
# Ctrl+ backspace delets the word
118-
119110
bindkey '^H' backward-kill-word
120111
bindkey '5~' kill-word
121112

122113
# [PageUp] - Up a line of history
123114
if [[ -n "${terminfo[kpp]}" ]]; then
124-
bindkey -M emacs "${terminfo[kpp]}" up-line-or-history
125-
bindkey -M viins "${terminfo[kpp]}" up-line-or-history
126-
bindkey -M vicmd "${terminfo[kpp]}" up-line-or-history
115+
bindkey -M emacs "${terminfo[kpp]}" up-line-or-history
116+
bindkey -M viins "${terminfo[kpp]}" up-line-or-history
117+
bindkey -M vicmd "${terminfo[kpp]}" up-line-or-history
127118
fi
128119
# [PageDown] - Down a line of history
129120
if [[ -n "${terminfo[knp]}" ]]; then
130-
bindkey -M emacs "${terminfo[knp]}" down-line-or-history
131-
bindkey -M viins "${terminfo[knp]}" down-line-or-history
132-
bindkey -M vicmd "${terminfo[knp]}" down-line-or-history
121+
bindkey -M emacs "${terminfo[knp]}" down-line-or-history
122+
bindkey -M viins "${terminfo[knp]}" down-line-or-history
123+
bindkey -M vicmd "${terminfo[knp]}" down-line-or-history
133124
fi
134125

135126
# Start typing + [Up-Arrow] - fuzzy find history forward
136127
if [[ -n "${terminfo[kcuu1]}" ]]; then
137-
autoload -U up-line-or-beginning-search
138-
zle -N up-line-or-beginning-search
128+
autoload -U up-line-or-beginning-search
129+
zle -N up-line-or-beginning-search
139130

140-
bindkey -M emacs "${terminfo[kcuu1]}" up-line-or-beginning-search
141-
bindkey -M viins "${terminfo[kcuu1]}" up-line-or-beginning-search
142-
bindkey -M vicmd "${terminfo[kcuu1]}" up-line-or-beginning-search
131+
bindkey -M emacs "${terminfo[kcuu1]}" up-line-or-beginning-search
132+
bindkey -M viins "${terminfo[kcuu1]}" up-line-or-beginning-search
133+
bindkey -M vicmd "${terminfo[kcuu1]}" up-line-or-beginning-search
143134
fi
144135
# Start typing + [Down-Arrow] - fuzzy find history backward
145136
if [[ -n "${terminfo[kcud1]}" ]]; then
146-
autoload -U down-line-or-beginning-search
147-
zle -N down-line-or-beginning-search
137+
autoload -U down-line-or-beginning-search
138+
zle -N down-line-or-beginning-search
148139

149-
bindkey -M emacs "${terminfo[kcud1]}" down-line-or-beginning-search
150-
bindkey -M viins "${terminfo[kcud1]}" down-line-or-beginning-search
151-
bindkey -M vicmd "${terminfo[kcud1]}" down-line-or-beginning-search
140+
bindkey -M emacs "${terminfo[kcud1]}" down-line-or-beginning-search
141+
bindkey -M viins "${terminfo[kcud1]}" down-line-or-beginning-search
142+
bindkey -M vicmd "${terminfo[kcud1]}" down-line-or-beginning-search
152143
fi
153144

154145
# [Home] - Go to beginning of line
155146
if [[ -n "${terminfo[khome]}" ]]; then
156-
bindkey -M emacs "${terminfo[khome]}" beginning-of-line
157-
bindkey -M viins "${terminfo[khome]}" beginning-of-line
158-
bindkey -M vicmd "${terminfo[khome]}" beginning-of-line
147+
bindkey -M emacs "${terminfo[khome]}" beginning-of-line
148+
bindkey -M viins "${terminfo[khome]}" beginning-of-line
149+
bindkey -M vicmd "${terminfo[khome]}" beginning-of-line
159150
fi
160151
# [End] - Go to end of line
161152
if [[ -n "${terminfo[kend]}" ]]; then
162-
bindkey -M emacs "${terminfo[kend]}" end-of-line
163-
bindkey -M viins "${terminfo[kend]}" end-of-line
164-
bindkey -M vicmd "${terminfo[kend]}" end-of-line
153+
bindkey -M emacs "${terminfo[kend]}" end-of-line
154+
bindkey -M viins "${terminfo[kend]}" end-of-line
155+
bindkey -M vicmd "${terminfo[kend]}" end-of-line
165156
fi
166157

167158
# [Shift-Tab] - move through the completion menu backwards
168159
if [[ -n "${terminfo[kcbt]}" ]]; then
169-
bindkey -M emacs "${terminfo[kcbt]}" reverse-menu-complete
170-
bindkey -M viins "${terminfo[kcbt]}" reverse-menu-complete
171-
bindkey -M vicmd "${terminfo[kcbt]}" reverse-menu-complete
160+
bindkey -M emacs "${terminfo[kcbt]}" reverse-menu-complete
161+
bindkey -M viins "${terminfo[kcbt]}" reverse-menu-complete
162+
bindkey -M vicmd "${terminfo[kcbt]}" reverse-menu-complete
172163
fi
173164

174165
# [Backspace] - delete backward
@@ -177,66 +168,56 @@ bindkey -M viins '^?' backward-delete-char
177168
bindkey -M vicmd '^?' backward-delete-char
178169
# [Delete] - delete forward
179170
if [[ -n "${terminfo[kdch1]}" ]]; then
180-
bindkey -M emacs "${terminfo[kdch1]}" delete-char
181-
bindkey -M viins "${terminfo[kdch1]}" delete-char
182-
bindkey -M vicmd "${terminfo[kdch1]}" delete-char
171+
bindkey -M emacs "${terminfo[kdch1]}" delete-char
172+
bindkey -M viins "${terminfo[kdch1]}" delete-char
173+
bindkey -M vicmd "${terminfo[kdch1]}" delete-char
183174
else
184-
bindkey -M emacs "^[[3~" delete-char
185-
bindkey -M viins "^[[3~" delete-char
186-
bindkey -M vicmd "^[[3~" delete-char
175+
bindkey -M emacs "^[[3~" delete-char
176+
bindkey -M viins "^[[3~" delete-char
177+
bindkey -M vicmd "^[[3~" delete-char
187178

188-
bindkey -M emacs "^[3;5~" delete-char
189-
bindkey -M viins "^[3;5~" delete-char
190-
bindkey -M vicmd "^[3;5~" delete-char
179+
bindkey -M emacs "^[3;5~" delete-char
180+
bindkey -M viins "^[3;5~" delete-char
181+
bindkey -M vicmd "^[3;5~" delete-char
191182
fi
192183

193184
typeset -g -A key
194185
if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then
195-
autoload -Uz add-zle-hook-widget
196-
function zle_application_mode_start { echoti smkx }
197-
function zle_application_mode_stop { echoti rmkx }
198-
add-zle-hook-widget -Uz zle-line-init zle_application_mode_start
199-
add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop
186+
autoload -Uz add-zle-hook-widget
187+
function zle_application_mode_start { echoti smkx }
188+
function zle_application_mode_stop { echoti rmkx }
189+
add-zle-hook-widget -Uz zle-line-init zle_application_mode_start
190+
add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop
200191
fi
201192

202193
# Control Left - go back a word
203194
key[Control-Left]="${terminfo[kLFT5]}"
204195
if [[ -n "${key[Control-Left]}" ]]; then
205-
bindkey -M emacs "${key[Control-Left]}" backward-word
206-
bindkey -M viins "${key[Control-Left]}" backward-word
207-
bindkey -M vicmd "${key[Control-Left]}" backward-word
196+
bindkey -M emacs "${key[Control-Left]}" backward-word
197+
bindkey -M viins "${key[Control-Left]}" backward-word
198+
bindkey -M vicmd "${key[Control-Left]}" backward-word
208199
fi
209200

210201
# Control Left - go forward a word
211202
key[Control-Right]="${terminfo[kRIT5]}"
212203
if [[ -n "${key[Control-Right]}" ]]; then
213-
bindkey -M emacs "${key[Control-Right]}" forward-word
214-
bindkey -M viins "${key[Control-Right]}" forward-word
215-
bindkey -M vicmd "${key[Control-Right]}" forward-word
204+
bindkey -M emacs "${key[Control-Right]}" forward-word
205+
bindkey -M viins "${key[Control-Right]}" forward-word
206+
bindkey -M vicmd "${key[Control-Right]}" forward-word
216207
fi
217208

218209
# Alt Left - go back a word
219210
key[Alt-Left]="${terminfo[kLFT3]}"
220211
if [[ -n "${key[Alt-Left]}" ]]; then
221-
bindkey -M emacs "${key[Alt-Left]}" backward-word
222-
bindkey -M viins "${key[Alt-Left]}" backward-word
223-
bindkey -M vicmd "${key[Alt-Left]}" backward-word
212+
bindkey -M emacs "${key[Alt-Left]}" backward-word
213+
bindkey -M viins "${key[Alt-Left]}" backward-word
214+
bindkey -M vicmd "${key[Alt-Left]}" backward-word
224215
fi
225216

226217
# Control Right - go forward a word
227218
key[Alt-Right]="${terminfo[kRIT3]}"
228219
if [[ -n "${key[Alt-Right]}" ]]; then
229-
bindkey -M emacs "${key[Alt-Right]}" forward-word
230-
bindkey -M viins "${key[Alt-Right]}" forward-word
231-
bindkey -M vicmd "${key[Alt-Right]}" forward-word
220+
bindkey -M emacs "${key[Alt-Right]}" forward-word
221+
bindkey -M viins "${key[Alt-Right]}" forward-word
222+
bindkey -M vicmd "${key[Alt-Right]}" forward-word
232223
fi
233-
234-
# Load Mcfly
235-
export MCFLY_FUZZY=true
236-
export MCFLY_RESULTS=20
237-
export MCFLY_INTERFACE_VIEW=BOTTOM
238-
export MCFLY_RESULTS_SORT=LAST_RUN
239-
eval "$(mcfly init zsh)"
240-
241-
## Run neofetch
242-
#neofetch

0 commit comments

Comments
 (0)