legacy-dotfiles/zshrc

92 lines
2.6 KiB
Bash
Raw Normal View History

2011-01-11 02:48:06 +01:00
# -*- Mode: shell-script -*-
2010-12-05 12:50:00 +01:00
# Setup variables
PATH="${PATH}:/usr/local/bin:${HOME}/bin"
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'
# Functions
function env() {
exec /usr/bin/env "$@" | grep -v ^LESS_TERMCAP_
}
# Initialize colors.
autoload -U colors
colors
# Allow for functions in the prompt
setopt PROMPT_SUBST
# Autoload zsh functions.
fpath=(~/.zsh/functions $fpath)
autoload -U ~/.zsh/functions/*(:t)
# Enable auto-execution of functions
typeset -ga preexec_functions
typeset -ga precmd_functions
typeset -ga chpwd_functions
# Append git functions needed for prompt.
preexec_functions+='preexec_update_git_vars'
precmd_functions+='precmd_update_git_vars'
chpwd_functions+='chpwd_update_git_vars'
chpwd_functions+='chpwd_show_todo'
2010-12-05 12:50:00 +01:00
# Set the prompt.
PROMPT='%{${fg[cyan]}%}%B%~%b%{${fg[default]}%} %(?.%{${fg[green]}%}O.%{${fg[red]}%}X)%{${fg[default]}%} %# '
RPROMPT='$(prompt_git_info)%{${fg[default]}%}'
# 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=auto"
alias ls="ls -F --color=auto"
alias slrn="NNTPSERVER='news.eternal-september.org' slrn"
2011-01-11 02:48:06 +01:00
alias cower="cower --color=auto --target=$HOME/aur"
2010-12-05 12:50:00 +01:00
# Set terminal name to current runnign application
case $TERM in
rxvt*)
precmd () { print -Pn "\e]0;urxvt - %~\a" }
preexec () { print -Pn "\e]0;urxvt - $1\a" }
;;
esac
# 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
if [ -z $EMACS ]; then
source ~/.zsh/syntax-highlighting/zsh-syntax-highlighting.zsh
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=blue'
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=blue'
fi
if [ "$TERM" = "linux" ]; then
setfont /usr/share/kbd/consolefonts/Tamsyn8x15r.psf
fi