Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (51 sloc) 1.82 KB
# autoloaders
autoload -U colors; colors
autoload -U compinit; compinit -i
# completions
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
setopt correct_all
zstyle ':completion:*:*:kill:*' menu yes select
zstyle ':completion:*:kill:*' force-list always
zstyle ':completion:*' squeeze-slashes true
zstyle ':completion:*' completer _complete _match _approximate
zstyle ':completion:*:match:*' original only
zstyle -e ':completion:*:approximate:*' \
max-errors 'reply=($((($#PREFIX+$#SUFFIX)/2))numeric)'
fpath=($HOME/.zsh/completions $fpath)
bindkey '^R' history-incremental-search-backward
compinit -i
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.zsh/cache
# history
HISTFILE=$HOME/.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
# use /etc/hosts and known_hosts for hostname completion
[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() [ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
hosts=(
"$_global_ssh_hosts[@]"
"$_ssh_hosts[@]"
"$_etc_hosts[@]"
"$HOST"
localhost
)
zstyle ':completion:*:hosts' hosts $hosts
# git plugin
source ~/.zsh/git-prompt/zshrc.sh
# common stuff
export EDITOR=vim
export PAGER=less
# prompt
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
export PS1=$'%{\e[0;1m\e[38;5;161m%}%m%{\e[0m%}:%{\e[0;1m\e[38;5;118m%}%~%{\e[0m%}$(git_super_status) %(!.%{\e[0;1m\e[38;5;009m%}#%{\e[0m%}.$) '
# aliases
alias ll="ls -al"