5 for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
6 eval _$color='%{$terminfo[bold]$fg[${(L)color}]%}'
7 eval $color='%{$fg[${(L)color}]%}'
8 (( count = $count + 1 ))
13 #RPROMPT=$(echo "$RED%D %T$FINISH")
14 #PROMPT=$(echo "$CYAN%n[$BLUE%~]$_YELLOW>>$FINISH ")
15 PROMPT=$(echo "%B$CYAN%n$_YELLOW@$BLUE%<<[%~%<<]$_YELLOW>> $WHITE%b")
19 export HISTFILE="$HOME/.zsh_history"
20 setopt INC_APPEND_HISTORY
21 setopt HIST_IGNORE_DUPS
22 setopt EXTENDED_HISTORY
25 setopt HIST_IGNORE_SPACE
30 export LSCOLORS=ExFxCxDxBxegedabagaced
36 GROFF_NO_SGR=$(printf "1") \
37 LESS_TERMCAP_mb=$(printf "\e[1;31m") \
38 LESS_TERMCAP_md=$(printf "\e[1;31m") \
39 LESS_TERMCAP_me=$(printf "\e[0m") \
40 LESS_TERMCAP_se=$(printf "\e[0m") \
41 LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
42 LESS_TERMCAP_ue=$(printf "\e[0m") \
43 LESS_TERMCAP_us=$(printf "\e[1;32m") \
48 export PYTHONPATH="/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/"
49 export DEV_ENV_ROOT=$HOME/android/
50 export ANDROID_NDK_ROOT="${DEV_ENV_ROOT}/android-ndk-r8c/"
51 export ANDROID_SDK_ROOT="${DEV_ENV_ROOT}/android-sdk-macosx/"
52 #export ANDROID_TOOLCHAIN="${DEV_ENV_ROOT}/standalone-toolchain-api14/"
53 export ANDROID_NDK_HOME="$HOME/android/android-ndk-r8c"
57 export ANDROID_TOOLCHAIN="$ANDROID_NDK_HOME/standalone-toolchain-api14/"
60 export ANDROID_HOME="/Users/peli3/android/android-sdk-macosx/"
62 export PATH=$PATH:"${ANDROID_TOOLCHAIN}/bin/":"${ANDROID_HOME}/platform-tools/"
63 export PATH="$HOME/bin":"/usr/local/bin":$PATH
65 ###====================
69 #zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
70 #zstyle ':completion:*:warnings' format '%BSorry, no matches for: %d%b'
73 ######################## zsh alias #########################
75 alias grep='grep --color -E'
76 #alias mvim='mvim --remote-silent'
77 #alias vim='/usr/local/bin/mvim -v'
84 alias diff='colordiff'
91 alias sed='/usr/local/bin/gsed'
95 ########################### zsh completion ##########################
100 #zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
101 #zstyle ':completion:*:warnings' format '%BSorry, no matches for: %d%b'
103 #autoload -U compinit
106 #autoload -U promptinit
112 zstyle ':completion:*' menu select
121 WORDCHARS='*?_-[]~=&;!#$%^(){}<>'
126 #http://techanic.net/2012/12/30/my_git_prompt_for_zsh.html
127 # Adapted from code found at <https://gist.github.com/1712320>.
130 autoload -U colors && colors # Enable colors in prompt
132 # Modify the colors and symbols in these variables as desired.
133 GIT_PROMPT_SYMBOL="%{$fg[blue]%}±"
134 GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$reset_color%}"
135 GIT_PROMPT_SUFFIX="%{$fg[green]%}]%{$reset_color%}"
136 GIT_PROMPT_AHEAD="%{$fg[red]%}ANUM%{$reset_color%}"
137 GIT_PROMPT_BEHIND="%{$fg[cyan]%}BNUM%{$reset_color%}"
138 GIT_PROMPT_MERGING="%{$fg_bold[magenta]%}⚡︎%{$reset_color%}"
139 GIT_PROMPT_UNTRACKED="%{$fg_bold[red]%}●%{$reset_color%}"
140 GIT_PROMPT_MODIFIED="%{$fg_bold[yellow]%}●%{$reset_color%}"
141 GIT_PROMPT_STAGED="%{$fg_bold[green]%}●%{$reset_color%}"
143 # Show Git branch/tag, or name-rev if on detached head
145 (git symbolic-ref -q HEAD || git name-rev --name-only --no-undefined --always HEAD) 2> /dev/null
148 # Show different symbols as appropriate for various Git repository states
151 # Compose this value via multiple conditional appends.
154 local NUM_AHEAD="$(git log --oneline @{u}.. 2> /dev/null | wc -l | tr -d ' ')"
155 if [ "$NUM_AHEAD" -gt 0 ]; then
156 GIT_STATE=$GIT_STATE${GIT_PROMPT_AHEAD//NUM/$NUM_AHEAD}
159 local NUM_BEHIND="$(git log --oneline ..@{u} 2> /dev/null | wc -l | tr -d ' ')"
160 if [ "$NUM_BEHIND" -gt 0 ]; then
161 GIT_STATE=$GIT_STATE${GIT_PROMPT_BEHIND//NUM/$NUM_BEHIND}
164 local GIT_DIR="$(git rev-parse --git-dir 2> /dev/null)"
165 if [ -n $GIT_DIR ] && test -r $GIT_DIR/MERGE_HEAD; then
166 GIT_STATE=$GIT_STATE$GIT_PROMPT_MERGING
169 if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then
170 GIT_STATE=$GIT_STATE$GIT_PROMPT_UNTRACKED
173 if ! git diff --quiet 2> /dev/null; then
174 GIT_STATE=$GIT_STATE$GIT_PROMPT_MODIFIED
177 if ! git diff --cached --quiet 2> /dev/null; then
178 GIT_STATE=$GIT_STATE$GIT_PROMPT_STAGED
181 if [[ -n $GIT_STATE ]]; then
182 echo "$GIT_PROMPT_PREFIX$GIT_STATE$GIT_PROMPT_SUFFIX"
187 # If inside a Git repository, print its branch and state
188 git_prompt_string() {
189 local git_where="$(parse_git_branch)"
190 [ -n "$git_where" ] && echo "$GIT_PROMPT_SYMBOL$(parse_git_state)$GIT_PROMPT_PREFIX%{$fg[yellow]%}${git_where#(refs/heads/|tags/)}$GIT_PROMPT_SUFFIX"
193 # Set the right-hand prompt
194 RPS1='$(git_prompt_string)'
196 #source ~/Private/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh
197 source ~/.zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
198 # http://stackoverflow.com/questions/3483604/which-shortcut-in-zsh-does-the-same-as-ctrl-u-in-bash
199 bindkey \^U backward-kill-line
201 export PYTHONSTARTUP="$HOME/.pythonrc"
203 export ZSHHOME="$HOME/.zsh"
204 [[ -f "$ZSHHOME/cpverc" ]] && . "$ZSHHOME/cpverc"
205 [[ -f "$ZSHHOME/eccrc" ]] && . "$ZSHHOME/eccrc"
208 #` git log --oneline --abbrev-commit --all --graph --decorate --color `
209 [[ -s `brew --prefix`/etc/autojump.sh ]] && . `brew --prefix`/etc/autojump.sh