cleans zshrc up a bit and enhances the behavior of history search

This commit is contained in:
Martinez 2017-02-27 01:00:12 +01:00
parent a5adb850f3
commit f83777f7f9

View file

@ -1,6 +1,4 @@
# bindkey -v # editor jako vi
bindkey -e # editor jako emacs
bindkey ' ' magic-space # mezerník rozbaluje odkazy na historii
bindkey -e # emacs mode
alias ls="ls --classify --color --group-directories-first --quoting-style=literal"
alias l="ls --human-readable -l"
@ -117,34 +115,40 @@ swap-files() {
mv "$1" "$TMP" && mv "$2" "$1" && mv "$TMP" "$2"
}
HISTFILE=~/.history # soubor pro ukládání do historie
SAVEHIST=5000 # ukládá se 5000 příkazů
HISTSIZE=5000 # :)
# history including search
HISTFILE=~/.history
SAVEHIST=5000
HISTSIZE=5000
setopt HIST_IGNORE_SPACE
setopt HIST_IGNORE_ALL_DUPS
#setopt SHARE_HISTORY
#setopt EXTENDED_HISTORY
setopt INC_APPEND_HISTORY
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "^[[A" up-line-or-beginning-search # Up
bindkey "^[[B" down-line-or-beginning-search # Down
setopt EXTENDED_GLOB
unsetopt NO_CLOBBER # ochrana při přesměrovávání výstupů
unsetopt CORRECTALL # opravy překlepů
setopt NO_BEEP # nepípat při chybách
unsetopt equals # kvůli emerge =něco
export ZLE_REMOVE_SUFFIX_CHARS=$' \t\n;&'
unsetopt NO_CLOBBER # prevents cat < file > file
unsetopt CORRECTALL # hell no
setopt NO_BEEP # hell no
unsetopt equals # allows me to use strings like =this without escaping
export ZLE_REMOVE_SUFFIX_CHARS=$' \t\n;&' # don't remove these chars after completion
# File completion
setopt AUTOLIST # vypisuje možnosti pro doplnění
setopt NO_LIST_AMBIGUOUS # vypisuje je HNED, ne až při druhém <Tab>
setopt LIST_PACKED # zkrácený výpis
zmodload -i zsh/complist # obarví vypisované soubory
setopt AUTOLIST
setopt NO_LIST_AMBIGUOUS # list files immediately
setopt LIST_PACKED
zmodload -i zsh/complist # colors
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion::complete:*' use-cache 1
zstyle ':completion:*' special-dirs true
autoload -U compinit # aktivuje "standardní" pravidla pro doplňování
autoload -U compinit
compinit
autoload colors zsh/terminfo
# app-shells/over-prompt
source /usr/share/over-prompt/zsh-init
# keyboard stuff
@ -162,8 +166,6 @@ bindkey "\eOH" beginning-of-line
bindkey "\eOF" end-of-line
bindkey "\eOd" backward-word
bindkey "\eOc" forward-word
bindkey '\e[A' history-beginning-search-backward
bindkey '\e[B' history-beginning-search-forward
# paludis default options
export CAVE_OPTIONS="--log-level warning"