Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
source ~/.profile

########## ZSH STUFF

autoload colors

########## HISTORY

HISTSIZE=5000
SAVEHIST=5000
HISTFILE=~/.zsh_history
setopt INC_APPEND_HISTORY
setopt HIST_IGNORE_DUPS
setopt PROMPT_SUBST

########## PROMPT

# Prints the current Ruby version (1.8.6, 1.9.1, ...)
ruby_version() {
    echo " ruby=$(readlink /usr/local/ruby | xargs basename | sed -e 's/^ruby-//')"
}

# Prints the current Mercurial branch when in a Mercurial repository
hg_branch() {
    if [[ -f .hg/branch ]]
    then echo " branch=$(cat .hg/branch)"
    else echo " "
    fi
}

PROMPT_COLOR='%{\e[1;36m%}'

PROMPT="$(print $PROMPT_COLOR)%Battignawantan %(?.✓.✗) %25<…<%~%<< ▸%b "
RPROMPT='$(print $PROMPT_COLOR)%B$(ruby_version)$(hg_branch)%b'

########## COLORS

export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'

########## COMPLETION

zstyle ':completion:*' auto-description 'Specify %d'
zstyle ':completion:*' completer _expand _complete
zstyle ':completion:*' format 'Completing %d'
zstyle ':completion:*' group-name ''
zstyle ':completion:*' ignore-parents parent pwd
zstyle ':completion:*' insert-unambiguous true
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' menu select=1
zstyle ':completion:*' original false
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*' verbose true
zstyle :compinstall filename '/Users/ddfreyne/.zshrc'

autoload -Uz compinit
compinit

########## HISTORY

bindkey "\e[A" up-line-or-search
bindkey "\e[B" down-line-or-search