dotfiles/.config/zsh/.zshrc

120 lines
3.7 KiB
Bash
Raw Normal View History

2023-09-26 17:12:28 +02:00
# Path to your oh-my-zsh installation.
ZSH=/usr/share/oh-my-zsh/
ZSH_CUSTOM=/usr/share/zsh/
2023-09-26 17:12:28 +02:00
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
HYPHEN_INSENSITIVE="true"
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="true"
plugins=(git-prompt sudo zsh-autosuggestions)
2023-09-26 17:12:28 +02:00
ZSH_CACHE_DIR=$HOME/.cache/oh-my-zsh
ZSH_COMPDUMP="$ZSH_CACHE_DIR/.zcompdump"
2023-09-26 17:12:28 +02:00
if [[ ! -d $ZSH_CACHE_DIR ]]; then
mkdir $ZSH_CACHE_DIR
fi
# If not running interactively, don't do anything
[[ $- != *i* ]] && exit
# Disable bell
unsetopt autocd beep
# Enable case-insensitive auto completion
#autoload -Uz compinit && compinit
#zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}'
2023-09-26 17:12:28 +02:00
# Set prompt
PROMPT="%B%F{198}%n%F{015}@%F{014}%m%F{015}:%F{198}%42<..<%~%F{015}> %b%f"
2023-09-26 17:12:28 +02:00
#autoload -Uz promptinit && promptinit
# History settings
HISTFILE="$XDG_STATE_HOME/zsh/history"
2023-09-26 17:12:28 +02:00
HISTSIZE=10000
SAVEHIST=10000
setopt appendhistory
setopt extended_history
setopt share_history
setopt inc_append_history
setopt hist_find_no_dups
setopt hist_reduce_blanks
# Enable case-insensitive globbing
setopt no_case_glob
setopt glob_complete
autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
if [[ -z $SSH_TTY ]]; then
(cat ~/.cache/wal/sequences &)
# source ~/.cache/wal/colors-tty.sh
fi
2023-09-26 17:12:28 +02:00
# 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]}"
key[Control-Left]="${terminfo[kLFT5]}"
key[Control-Right]="${terminfo[kRIT5]}"
key[Control-Backspace]="^H"
key[Control-Delete]="^5"
# Setup key accordingly
bindkey -- "${key[Home]}" beginning-of-line
bindkey -- "${key[End]}" end-of-line
bindkey -- "${key[Insert]}" overwrite-mode
bindkey -- "${key[Backspace]}" backward-delete-char
bindkey -- "${key[Delete]}" delete-char
bindkey -- "${key[Up]}" up-line-or-history
bindkey -- "${key[Down]}" down-line-or-history
bindkey -- "${key[Left]}" backward-char
bindkey -- "${key[Right]}" forward-char
bindkey -- "${key[PageUp]}" beginning-of-buffer-or-history
bindkey -- "${key[PageDown]}" end-of-buffer-or-history
bindkey -- "${key[Shift-Tab]}" reverse-menu-complete
bindkey -- "${key[Up]}" up-line-or-beginning-search
bindkey -- "${key[Down]}" down-line-or-beginning-search
bindkey -- "${key[Control-Left]}" backward-word
bindkey -- "${key[Control-Right]}" forward-word
bindkey -- "${key[Control-Delete]}" kill-word
bindkey -M emacs "${key[Control-Backspace]}" backward-kill-word
bindkey -M viins "${key[Control-Backspace]}" backward-kill-word
bindkey -M vicmd "${key[Control-Backspace]}" backward-kill-word
# Finally, make sure the terminal is in application mode, when zle is
# active. Only then are the values from $terminfo valid.
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
2024-02-21 08:11:00 +01:00
2024-02-21 08:13:35 +01:00
eval "$(zoxide init --cmd cd zsh)"
2024-02-21 08:11:00 +01:00
2023-09-26 17:12:28 +02:00
source $ZSH/oh-my-zsh.sh
source $ZDOTDIR/.zaliases