source /etc/profile source ~/.zsh/aliases # history HISTFILE=~/.zsh_history HISTSIZE=5000 SAVEHIST=1000 setopt appendhistory extendedglob no_beep auto_cd complete_in_word correct autoload -U compinit && compinit autoload -U edit-command-line eval `dircolors` # prompt (if running screen, show window #) if [ x$WINDOW != x ]; then export PS1="$WINDOW:%n@%m:%~%# " else export PS1='%n@%m:%~%# ' fi # format titles for screen and rxvt function title() { # escape '%' chars in $1, make nonprintables visible a=${(V)1//\%/\%\%} # Truncate command, and join lines. a=$(print -Pn "%40>...>$a" | tr -d "\n") case $TERM in screen) print -Pn "\ek$a:$3\e\\" # screen title (in ^A") ;; xterm*|*rxvt*) print -Pn "\e]2;$2 | $a:$3\a" # plain xterm title ;; esac } # precmd is called just before the prompt is printed function precmd() { title "zsh" "$USER@%m" "%55<...<%~" } # preexec is called just before any command line is executed function preexec() { title "$1" "$USER@%m" "%35<...<%~" } function zle-line-init zle-keymap-select { if [ $VIMRUNTIME ]; then RPROMPT="[v|"; else RPROMPT="["; fi RPROMPT="${RPS1}${${KEYMAP/vicmd/n]}/(main|viins)/i]}" # FIXME This does not work properly with zle-line-init ATM. Is this a zshell # bug? See also # http://www.zsh.org/mla/users/2008/msg00774.html zle reset-prompt } zle -N zle-line-init zle -N zle-keymap-select zle -N edit-command-line # colorful listings zmodload -i zsh/complist zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} export RUBYOPT="-rubygems" # Tell Ruby to find the rubygems export HAXE_LIBRARY_PATH="/opt/haxe/std:." # haXe libraries export EDITOR=vim export PAGER=less export BROWSER=firefox bindkey -v bindkey '^R' history-incremental-search-backward bindkey '^?' backward-delete-char bindkey "\e[8~" end-of-line bindkey "\e[7~" beginning-of-line bindkey -M vicmd "v" edit-command-line