# Skip all this for non-interactive shells [[ -z "$PS1" ]] && return # Use Vim keybindings bindkey -v # Custom keybindings (movement) # normal terminal bindkey "\e[7~" beginning-of-line bindkey "\e[8~" end-of-line bindkey "\e[5~" history-search-backward bindkey "\e[6~" history-search-forward bindkey "\e[3~" delete-char bindkey "\e[2~" quoted-insert bindkey "\eOc" forward-word bindkey "\eOd" backward-word # Konsole bindkey "\e[H" beginning-of-line bindkey "\e[F" end-of-line bindkey "\e[1;5C" forward-word bindkey "\e[1;5D" backward-word # tmux bindkey "\e[1~" beginning-of-line bindkey "\e[4~" end-of-line bindkey "\eOC" forward-word bindkey "\eOD" backward-word bindkey "^P" push-input bindkey "^R" history-incremental-search-backward # Setup history HISTFILE=~/.histfile HISTSIZE=10000 SAVEHIST=10000 # Options setopt inc_append_history setopt share_history setopt hist_ignore_all_dups setopt hist_ignore_dups setopt appendhistory setopt autocd setopt autopushd setopt pushdminus setopt extendedglob setopt nomatch setopt notify setopt complete_in_word # Tab-Completion zstyle ':completion:*' list-colors ${(s.:.)LSCOLORS} zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' zstyle ':completion:*' menu select=1 zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s zstyle ':completion:*' use-compctl false zstyle ':completion:*' verbose true # Only show local files in the completion, no gopher://, cdda:// etc. zstyle ':completion:*:*:mplayer:*' tag-order files autoload -Uz compinit compinit # Enable color support of ls if [[ "$TERM" != "dumb" ]]; then if [[ -x `which dircolors` ]]; then eval `dircolors -b` alias 'ls=ls --color=auto' fi fi # set terminal title case $TERM in (*xterm* | *rxvt* | *alacritty*) # Write some info to terminal title. # This is seen when the shell prompts for input. function precmd { print -Pn "\e]0;zsh%L @%m %(1j,%j job%(2j|s|); ,)%~\a" } # Write command and args to terminal title. # This is seen while the shell waits for a command to complete. function preexec { printf "\033]0;%s @%s\a" "$1" "$HOST" } ;; esac # Set prompt #PS1=$'%(!.%{\e[01;32m%}.%{\e[01;31m%})%(?..%? )%(!.%{\e[01;31m%}.%{\e[01;32m%})%n@%m%{\e[01;34m%} %~ %{\e[00m%}%(!.#.$) ' PS1=$'%{\e[30m%}%(!.%{\e[41m%}.%{\e[42m%})%n@%m %{\e[1;37m%}%{\e[44m%} %~ %{\e[49m\e[0;34m%}▶%{\e[0m%} ' RPROMPT=$'%(?.%{\e[32m%}.%{\e[31m%})◀%{\e[30m%}%(?.%{\e[42m%} ✔ .%{\e[41m%} ✘ [%?] )%{\e[0m%}'