2013-02-11 14:08:07 +01:00
|
|
|
# Skip all this for non-interactive shells
|
2013-07-21 22:04:53 +02:00
|
|
|
[[ -z "$PS1" ]] && return
|
2013-02-11 14:08:07 +01:00
|
|
|
|
2013-07-21 22:04:53 +02:00
|
|
|
# Use Vim keybindings
|
|
|
|
bindkey -v
|
2013-02-11 14:08:07 +01:00
|
|
|
|
2013-07-21 22:04:53 +02:00
|
|
|
# Custom keybindings (movement)
|
|
|
|
# normal terminal
|
|
|
|
bindkey "\e[7~" beginning-of-line
|
|
|
|
bindkey "\e[8~" end-of-line
|
2013-02-11 14:08:07 +01:00
|
|
|
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
|
2013-07-21 22:04:53 +02:00
|
|
|
|
2015-01-03 16:48:04 +01:00
|
|
|
# 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
|
|
|
|
|
2013-07-21 22:04:53 +02:00
|
|
|
# tmux
|
|
|
|
bindkey "\e[1~" beginning-of-line
|
|
|
|
bindkey "\e[4~" end-of-line
|
|
|
|
bindkey "\eOC" forward-word
|
|
|
|
bindkey "\eOD" backward-word
|
|
|
|
|
2013-02-11 14:08:07 +01:00
|
|
|
bindkey "^P" push-input
|
2013-07-21 22:04:53 +02:00
|
|
|
bindkey "^R" history-incremental-search-backward
|
2013-02-11 14:08:07 +01:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2015-06-04 00:45:14 +02:00
|
|
|
# set terminal title
|
|
|
|
case $TERM in
|
2021-07-05 21:13:34 +02:00
|
|
|
(*xterm* | *rxvt* | *alacritty*)
|
2015-06-04 00:45:14 +02:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2013-02-11 14:08:07 +01:00
|
|
|
# Set prompt
|
2015-01-03 16:48:04 +01:00
|
|
|
#PS1=$'%(!.%{\e[01;32m%}.%{\e[01;31m%})%(?..%? )%(!.%{\e[01;31m%}.%{\e[01;32m%})%n@%m%{\e[01;34m%} %~ %{\e[00m%}%(!.#.$) '
|
2013-02-11 14:08:07 +01:00
|
|
|
|
2015-01-03 17:32:54 +01:00
|
|
|
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%}'
|