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-r10d/"
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-r10d"
57 export ANDROID_TOOLCHAIN="$ANDROID_NDK_HOME/standalone-toolchain-api14/"
60 export ANDROID_HOME="$HOME/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'
93 alias 'git-log'='git log --oneline --graph --all --color --decorate --abbrev-commit'
97 ########################### zsh completion ##########################
102 #zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
103 #zstyle ':completion:*:warnings' format '%BSorry, no matches for: %d%b'
105 #autoload -U compinit
108 #autoload -U promptinit
114 zstyle ':completion:*' menu select
123 WORDCHARS='*?_-[]~=&;!#$%^(){}<>'
128 #http://techanic.net/2012/12/30/my_git_prompt_for_zsh.html
129 # Adapted from code found at <https://gist.github.com/1712320>.
132 autoload -U colors && colors # Enable colors in prompt
134 # Modify the colors and symbols in these variables as desired.
135 GIT_PROMPT_SYMBOL="%{$fg[blue]%}±"
136 GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$reset_color%}"
137 GIT_PROMPT_SUFFIX="%{$fg[green]%}]%{$reset_color%}"
138 GIT_PROMPT_AHEAD="%{$fg[red]%}ANUM%{$reset_color%}"
139 GIT_PROMPT_BEHIND="%{$fg[cyan]%}BNUM%{$reset_color%}"
140 GIT_PROMPT_MERGING="%{$fg_bold[magenta]%}⚡︎%{$reset_color%}"
141 GIT_PROMPT_UNTRACKED="%{$fg_bold[red]%}•%{$reset_color%}"
142 GIT_PROMPT_MODIFIED="%{$fg_bold[yellow]%}•%{$reset_color%}"
143 GIT_PROMPT_STAGED="%{$fg_bold[green]%}•%{$reset_color%}"
145 # Show Git branch/tag, or name-rev if on detached head
147 (git symbolic-ref -q HEAD || git name-rev --name-only --no-undefined --always HEAD) 2> /dev/null
150 # Show different symbols as appropriate for various Git repository states
153 # Compose this value via multiple conditional appends.
156 local NUM_AHEAD="$(git log --oneline @{u}.. 2> /dev/null | wc -l | tr -d ' ')"
157 if [ "$NUM_AHEAD" -gt 0 ]; then
158 GIT_STATE=$GIT_STATE${GIT_PROMPT_AHEAD//NUM/$NUM_AHEAD}
161 local NUM_BEHIND="$(git log --oneline ..@{u} 2> /dev/null | wc -l | tr -d ' ')"
162 if [ "$NUM_BEHIND" -gt 0 ]; then
163 GIT_STATE=$GIT_STATE${GIT_PROMPT_BEHIND//NUM/$NUM_BEHIND}
166 local GIT_DIR="$(git rev-parse --git-dir 2> /dev/null)"
167 if [ -n $GIT_DIR ] && test -r $GIT_DIR/MERGE_HEAD; then
168 GIT_STATE=$GIT_STATE$GIT_PROMPT_MERGING
171 if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then
172 GIT_STATE=$GIT_STATE$GIT_PROMPT_UNTRACKED
175 if ! git diff --quiet 2> /dev/null; then
176 GIT_STATE=$GIT_STATE$GIT_PROMPT_MODIFIED
179 if ! git diff --cached --quiet 2> /dev/null; then
180 GIT_STATE=$GIT_STATE$GIT_PROMPT_STAGED
183 if [[ -n $GIT_STATE ]]; then
184 echo "$GIT_PROMPT_PREFIX$GIT_STATE$GIT_PROMPT_SUFFIX"
189 # If inside a Git repository, print its branch and state
190 git_prompt_string() {
191 local git_where="$(parse_git_branch)"
192 [ -n "$git_where" ] && echo "$GIT_PROMPT_SYMBOL$(parse_git_state)$GIT_PROMPT_PREFIX%{$fg[yellow]%}${git_where#(refs/heads/|tags/)}$GIT_PROMPT_SUFFIX"
195 # Set the right-hand prompt
196 RPS1='$(git_prompt_string)'
198 #source ~/Private/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh
199 source ~/.zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
200 # http://stackoverflow.com/questions/3483604/which-shortcut-in-zsh-does-the-same-as-ctrl-u-in-bash
201 bindkey \^U backward-kill-line
203 export PYTHONSTARTUP="$HOME/.pythonrc"
205 export ZSHHOME="$HOME/.zsh"
206 [[ -f "$ZSHHOME/cpverc" ]] && . "$ZSHHOME/cpverc"
207 [[ -f "$ZSHHOME/eccrc" ]] && . "$ZSHHOME/eccrc"
210 #` git log --oneline --abbrev-commit --all --graph --decorate --color `
211 [[ -s `brew --prefix`/etc/autojump.sh ]] && . `brew --prefix`/etc/autojump.sh
213 alias emacs='TERM=xterm-256color emacs -nw'
215 alias tw='open -a /Applications/TextWrangler.app/'
218 #function exists { which $1 &> /dev/null }
220 #if exists percol; then
221 # function percol_select_history() {
223 # exists gtac && tac="gtac" || { exists tac && tac="tac" || { tac="tail -r" } }
224 # BUFFER=$(fc -l -n 1 | eval $tac | percol --query "$LBUFFER")
225 # CURSOR=$#BUFFER # move cursor
226 # zle -R -c # refresh
229 # zle -N percol_select_history
230 # bindkey '^R' percol_select_history
232 export LANG='en_US.UTF-8'
233 export LC_ALL="en_US.UTF-8"
237 server='cmbu-ftp.cisco.com'
240 home='/FTPServer/users/peli3'
244 remotefile=${home}/${dir}/$2;
246 echo "copy ${localfile} to ftp://${server}${remotefile}"
247 lftp -e "mkdir ${home}/${dir}; put ${localfile} -o ${remotefile}; bye" -u $user,$pass $server
250 ls -rl jabber.log* | awk '{print $9}' | Xargs cat >> full.log
253 export MANPATH=$MANPATH:/usr/local/man
257 # https://github.com/Valloric/YouCompleteMe/issues/18
258 #export DYLD_FORCE_FLAT_NAMESPACE=1
260 ## appended by cpan initializaion
261 PATH="/Users/peli3/perl5/bin${PATH:+:${PATH}}"; export PATH;
262 PERL5LIB="/Users/peli3/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
263 PERL_LOCAL_LIB_ROOT="/Users/peli3/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
264 PERL_MB_OPT="--install_base \"/Users/peli3/perl5\""; export PERL_MB_OPT;
265 PERL_MM_OPT="INSTALL_BASE=/Users/peli3/perl5"; export PERL_MM_OPT;
270 export MANPATH=$MANPATH:${HOME}/perl5/man
272 export PATH=$PATH:"${HOME}/scripts"