2012-11-09 10:44:45 +01:00
|
|
|
# -*- Mode: shell-script; -*-
|
2012-11-28 10:18:43 +01:00
|
|
|
autoload -Uz add-zsh-hook
|
2012-12-04 17:46:11 +01:00
|
|
|
autoload -Uz compinit
|
|
|
|
autoload -U colors
|
|
|
|
autoload -Uz vcs_info
|
|
|
|
|
|
|
|
# Autoload zsh functions.
|
|
|
|
fpath=($HOME/.zsh/functions $fpath)
|
|
|
|
autoload -U $HOME/.zsh/functions/*(:t)
|
2012-11-28 10:18:43 +01:00
|
|
|
|
2010-12-05 12:50:00 +01:00
|
|
|
# Setup variables
|
2013-01-21 01:34:03 +01:00
|
|
|
HISTFILE=$HOME/.zsh/histfile
|
2011-02-23 21:09:36 +01:00
|
|
|
HISTSIZE=1000
|
|
|
|
SAVEHIST=1000
|
2012-11-09 10:44:45 +01:00
|
|
|
LESSCMD="/usr/bin/less -FXRS"
|
|
|
|
|
|
|
|
export LESS_TERMCAP_mb=$'\e[1;37m'
|
|
|
|
export LESS_TERMCAP_md=$'\e[1;37m'
|
|
|
|
export LESS_TERMCAP_me=$'\e[0m'
|
|
|
|
export LESS_TERMCAP_se=$'\e[0m'
|
|
|
|
export LESS_TERMCAP_so=$'\e[1;47;30m'
|
|
|
|
export LESS_TERMCAP_ue=$'\e[0m'
|
|
|
|
export LESS_TERMCAP_us=$'\e[0;36m'
|
|
|
|
export PAGER=$LESSCMD
|
|
|
|
|
|
|
|
# Aliases
|
|
|
|
alias alpine="alpine -p ""{imap.gmail.com/ssl/user=tom.willemsen@archlinux.us}remote_pinerc"""
|
|
|
|
alias evolus-pencil="/usr/lib/evolus-pencil-svn/evolus-pencil.sh"
|
|
|
|
alias grep="grep --color=always"
|
|
|
|
alias less=$LESSCMD
|
|
|
|
alias ls="ls -F --color=always"
|
|
|
|
alias mysql="mysql --pager"
|
2011-02-23 21:09:36 +01:00
|
|
|
|
2013-02-15 00:31:56 +01:00
|
|
|
# Suffix aliases
|
|
|
|
alias -s pdf="zathura"
|
2013-04-03 01:55:21 +02:00
|
|
|
alias -s xls="libreoffice"
|
2013-02-15 00:31:56 +01:00
|
|
|
|
2011-02-23 21:09:36 +01:00
|
|
|
setopt notify
|
2012-12-04 17:46:11 +01:00
|
|
|
setopt PROMPT_SUBST # Allow for functions in the prompt
|
2011-05-01 16:57:43 +02:00
|
|
|
setopt EXTENDED_GLOB
|
2011-02-23 21:09:36 +01:00
|
|
|
|
2012-11-10 12:57:14 +01:00
|
|
|
zstyle :compinstall filename '$HOME/.zshrc'
|
2011-02-23 21:09:36 +01:00
|
|
|
|
2010-12-05 12:50:00 +01:00
|
|
|
# Enable auto-execution of functions
|
|
|
|
typeset -ga preexec_functions
|
|
|
|
typeset -ga precmd_functions
|
|
|
|
typeset -ga chpwd_functions
|
|
|
|
|
2012-11-28 10:18:43 +01:00
|
|
|
add-zsh-hook preexec preexec_update_vars
|
|
|
|
add-zsh-hook precmd precmd_update_git_vars
|
|
|
|
add-zsh-hook precmd precmd_update_updates
|
|
|
|
add-zsh-hook precmd precmd_maybe_festival
|
2012-12-04 17:46:11 +01:00
|
|
|
add-zsh-hook precmd vcs_info
|
2012-11-28 10:18:43 +01:00
|
|
|
add-zsh-hook chpwd chpwd_update_git_vars
|
2010-12-05 12:50:00 +01:00
|
|
|
|
2013-04-11 15:30:31 +02:00
|
|
|
zstyle ':vcs_info:*' actionformats '%B%F{5}%a%f%%b %s:%r-%b %S'
|
2012-12-04 17:46:11 +01:00
|
|
|
zstyle ':vcs_info:*' enable bzr git hg svn
|
2013-04-11 15:30:31 +02:00
|
|
|
zstyle ':vcs_info:*' formats '%s:%r-%b %S'
|
|
|
|
zstyle ':vcs_info:*' nvcsformats '%~'
|
2012-12-04 17:46:11 +01:00
|
|
|
zstyle ':vcs_info:bzr:*' branchformat '%b'
|
|
|
|
|
2010-12-05 12:50:00 +01:00
|
|
|
# Set the prompt.
|
2013-04-11 15:30:31 +02:00
|
|
|
PROMPT='%B%(?.%F{2}+.%F{1}-) %F{6}%m%b%f ${vcs_info_msg_0_} %# '
|
2010-12-05 12:50:00 +01:00
|
|
|
|
2012-11-09 10:44:45 +01:00
|
|
|
# Set terminal name to current running application
|
2010-12-05 12:50:00 +01:00
|
|
|
case $TERM in
|
|
|
|
rxvt*)
|
2011-05-16 10:57:14 +02:00
|
|
|
precmd () { print -Pn "\e]0;%~\a" }
|
|
|
|
preexec () { print -Pn "\e]0;$1\a" }
|
2010-12-05 12:50:00 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2013-04-24 02:43:56 +02:00
|
|
|
add-to-list PATH "$HOME/usr/bin"
|
|
|
|
add-to-list PATH "/usr/local/clark/bin" t
|
|
|
|
|
|
|
|
add-to-list INFOPATH "$HOME/documents/info"
|
|
|
|
add-to-list INFOPATH "$HOME/.emacs.d/vendor-lisp/org/doc"
|
|
|
|
add-to-list INFOPATH "/usr/local/clark/share/info" t
|
|
|
|
|
2010-12-05 12:50:00 +01:00
|
|
|
# Set terminal keys
|
|
|
|
bindkey "\e[1~" beginning-of-line
|
|
|
|
bindkey "\e[4~" end-of-line
|
|
|
|
bindkey "\e[5~" beginning-of-history
|
|
|
|
bindkey "\e[6~" end-of-history
|
|
|
|
bindkey "\e[3~" delete-char
|
|
|
|
bindkey "\e[2~" quoted-insert
|
|
|
|
bindkey "\e[5C" forward-word
|
|
|
|
bindkey "\e0c" emacs-forward-word
|
|
|
|
bindkey "\e[5D" backward-word
|
|
|
|
bindkey "\e0d" emacs-backward-word
|
|
|
|
bindkey "\e\e[C" forward-word
|
|
|
|
bindkey "\e\e[D" backward-word
|
|
|
|
## for rxvt
|
|
|
|
bindkey "\e[8~" end-of-line
|
|
|
|
bindkey "\e[7~" beginning-of-line
|
|
|
|
## for non RH/Debian xterm, can't hurt for RH/Debian xterm
|
|
|
|
bindkey "\e0H" beginning-of-line
|
|
|
|
bindkey "\e0F" end-of-line
|
|
|
|
## for freebsd console
|
|
|
|
bindkey "\e[H" beginning-of-line
|
|
|
|
bindkey "\e[F" end-of-line
|
2011-01-11 13:39:45 +01:00
|
|
|
|
2012-02-13 23:15:41 +01:00
|
|
|
bindkey "^W" backward-delete-char
|
|
|
|
|
2011-05-16 10:57:14 +02:00
|
|
|
# Show syntax highlighting when we're not running in emacs
|
2012-07-25 22:40:50 +02:00
|
|
|
if [ -z $EMACS ]; then
|
2012-11-10 12:57:14 +01:00
|
|
|
source $HOME/.zsh/syntax-highlighting/zsh-syntax-highlighting.zsh
|
2011-01-28 19:25:50 +01:00
|
|
|
|
2012-07-25 22:40:50 +02:00
|
|
|
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=blue'
|
|
|
|
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=blue'
|
|
|
|
fi
|
2012-12-04 17:46:11 +01:00
|
|
|
|
|
|
|
compinit
|
|
|
|
colors # Initialize colors.
|