71 lines
2.7 KiB
Text
71 lines
2.7 KiB
Text
#load modules
|
|
source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh
|
|
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh
|
|
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
|
|
|
# Parch Linux Functions
|
|
source /usr/share/parchlinux/zsh/functions/extract.zsh
|
|
source /usr/share/parchlinux/zsh/functions/coin.zsh
|
|
source /usr/share/parchlinux/zsh/functions/dice.zsh
|
|
source /usr/share/parchlinux/zsh/functions/fireworks.zsh
|
|
source /usr/share/parchlinux/zsh/functions/genpass.zsh
|
|
source /usr/share/parchlinux/zsh/functions/typewriter.zsh
|
|
source /usr/share/parchlinux/zsh/functions/weather.zsh
|
|
source /usr/share/parchlinux/zsh/functions/saferm.zsh
|
|
|
|
source /usr/lib/spaceship-prompt/spaceship.zsh
|
|
|
|
[[ -f /usr/share/parchlinux/zsh/alias/alias ]] && source /usr/share/parchlinux/zsh/alias/alias
|
|
|
|
|
|
# functions
|
|
|
|
autoload -Uz compinit
|
|
compinit
|
|
|
|
# Changes
|
|
|
|
zstyle ':completion::complete:*' gain-privileges 1
|
|
|
|
|
|
|
|
# Keyboard
|
|
|
|
# create a zkbd compatible hash;
|
|
# to add other keys to this hash, see: man 5 terminfo
|
|
typeset -g -A key
|
|
|
|
key[Home]="${terminfo[khome]}"
|
|
key[End]="${terminfo[kend]}"
|
|
key[Insert]="${terminfo[kich1]}"
|
|
key[Backspace]="${terminfo[kbs]}"
|
|
key[Delete]="${terminfo[kdch1]}"
|
|
key[Up]="${terminfo[kcuu1]}"
|
|
key[Down]="${terminfo[kcud1]}"
|
|
key[Left]="${terminfo[kcub1]}"
|
|
key[Right]="${terminfo[kcuf1]}"
|
|
key[PageUp]="${terminfo[kpp]}"
|
|
key[PageDown]="${terminfo[knp]}"
|
|
key[Shift-Tab]="${terminfo[kcbt]}"
|
|
|
|
# setup key accordingly
|
|
[[ -n "${key[Home]}" ]] && bindkey -- "${key[Home]}" beginning-of-line
|
|
[[ -n "${key[End]}" ]] && bindkey -- "${key[End]}" end-of-line
|
|
[[ -n "${key[Insert]}" ]] && bindkey -- "${key[Insert]}" overwrite-mode
|
|
[[ -n "${key[Backspace]}" ]] && bindkey -- "${key[Backspace]}" backward-delete-char
|
|
[[ -n "${key[Delete]}" ]] && bindkey -- "${key[Delete]}" delete-char
|
|
bindkey '^[[A' history-substring-search-up
|
|
bindkey '^[[B' history-substring-search-down
|
|
[[ -n "${key[Left]}" ]] && bindkey -- "${key[Left]}" backward-char
|
|
[[ -n "${key[Right]}" ]] && bindkey -- "${key[Right]}" forward-char
|
|
[[ -n "${key[PageUp]}" ]] && bindkey -- "${key[PageUp]}" beginning-of-buffer-or-history
|
|
[[ -n "${key[PageDown]}" ]] && bindkey -- "${key[PageDown]}" end-of-buffer-or-history
|
|
[[ -n "${key[Shift-Tab]}" ]] && bindkey -- "${key[Shift-Tab]}" reverse-menu-complete
|
|
bindkey '^[^?' backward-kill-word
|
|
if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then
|
|
autoload -Uz add-zle-hook-widget
|
|
function zle_application_mode_start { echoti smkx }
|
|
function zle_application_mode_stop { echoti rmkx }
|
|
add-zle-hook-widget -Uz zle-line-init zle_application_mode_start
|
|
add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop
|
|
fi
|