History

January 13, 2020 · View on GitHub

###[ ZSH ]

History

HISTFILE=~/.zsh_history HISTSIZE=10000 SAVEHIST=10000 setopt append_history setopt extended_history setopt hist_expire_dups_first setopt hist_ignore_dups setopt hist_ignore_space setopt hist_verify setopt inc_append_history setopt share_history

Prompt

autoload -U promptinit promptinit setopt PROMPT_SUBST

Other options

setopt rmstarsilent setopt interactivecomments

Keybinding

bindkey -e bindkey '^i' expand-or-complete-prefix bindkey '^[[1;5C' forward-word bindkey '^[[1;5D' backward-word bindkey '^[[H' beginning-of-line bindkey '^[[F' end-of-line bindkey "terminfo[khome]"beginningoflinebindkey"{terminfo[khome]}" beginning-of-line bindkey "{terminfo[kend]}" end-of-line bindkey "terminfo[kcbt]"reversemenucompletebindkey"{terminfo[kcbt]}" reverse-menu-complete bindkey "{terminfo[kdch1]}" delete-char autoload -U select-word-style select-word-style bash

Auto-completion

autoload -U compinit compinit zstyle ':completion:' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|=' 'l:|=* r:|=' zstyle ':completion:' menu select

###[ Other ]

Default editor

export EDITOR='vim'

Aliases

alias grep='/usr/bin/grep --color=auto' alias ll='ls --color -l' alias ls='ls --color=auto'

Midnight Commander chdir enhancement

if [ -f /usr/lib/mc/mc.sh ]; then source /usr/lib/mc/mc.sh fi

Syntax highlighting

if [ -f /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

ZSH_HIGHLIGHT_STYLES[globbing]='fg=cyan'
ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=cyan'
ZSH_HIGHLIGHT_STYLES[comment]='fg=white,bold'

fi

History substring serach

if [ -f /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh ]; then source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh

bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down

fi

GBT prompt forwarding

export GBT__HOME='/usr/share/gbt'

if [ -f GBT__HOME/sources/gbts/cmd/local.sh ]; then source GBT__HOME/sources/gbts/cmd/local.sh fi

Basic prompt for non-graphical terminals

if [[ "TERM" != xterm* ]] && [ -f GBT__HOME/themes/basic.sh ]; then source $GBT__HOME/themes/basic.sh fi

GBT prompt

PROMPT='(gbt(gbt ?)'