root/dotfiles/zsh/kozo-ni/.zshrc @ 34480

Revision 34480, 3.0 kB (checked in by kozo-ni, 4 years ago)

maven version up

Line 
1# http://devel.aquahill.net/zsh/dot.zshrc
2echo "Loading $HOME/.zshrc"
3
4### environment variables
5export EDITOR=vim
6export GISTY_DIR="$HOME/dev/gists"
7
8# Java (ubuntu)
9export JAVA_HOME=/usr/lib/jvm/java-6-sun
10export JAVA=$JAVA_HOME/bin
11
12# maven
13export M2_HOME=$HOME/apache-maven-2.2.0
14export M2=$M2_HOME/bin
15
16# pax-construct
17export PAX_CONSTRUCT_HOME=$HOME/pax-construct-1.4
18export PAX_CONSTRUCT=$PAX_CONSTRUCT_HOME/bin
19
20# macports
21export MACPORTS_BIN=/opt/local/bin
22export MACPORTS_SBIN=/opt/local/sbin
23export MACPORTS=$MACPORTS_BIN:$MACPORTS_SBIN
24
25export PATH=$M2:$MACPORTS:$HOME/bin:$PAX_CONSTRUCT:$JAVA:$PATH
26
27### shell variables
28HISTFILE=$HOME/.zsh_history
29HISTSIZE=1024
30# http://journal.mycom.co.jp/column/zsh/002/index.html
31PROMPT="[%n@%m]%~%# "
32SAVEHIST=2048
33VIMRC=$HOME/.vimrc
34
35### key bindings
36bindkey -e
37
38# historical backward/forward search with linehead string binded to ^P/^N
39autoload history-search-end
40zle -N history-beginning-search-backward-end history-search-end
41zle -N history-beginning-search-forward-end history-search-end
42bindkey "^p" history-beginning-search-backward-end
43bindkey "^n" history-beginning-search-forward-end
44bindkey "^[/" expand-cmd-path
45
46zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
47
48# http://hatena.g.hatena.ne.jp/hatenatech/20060517/1147833430
49zstyle ':completion:*:sudo:*' command-path /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin
50
51source $HOME/.zsh/aliases
52source $HOME/.zsh/zshoptions
53
54#
55# Default shell configuration
56#
57autoload -U colors
58colors
59autoload -U compinit
60compinit
61autoload predict-on
62predict-on
63
64# http://nijino.homelinux.net/diary/200206.shtml#200206140
65
66if [ "$TERM" = "screen-bce" ]; then
67        chpwd () { echo -n "_`dirs`\\" && ls}
68        preexec() {
69                # see [zsh-workers:13180]
70                # http://www.zsh.org/mla/workers/2000/msg03993.html
71                emulate -L zsh
72                local -a cmd; cmd=(${(z)2})
73                case $cmd[1] in
74                        fg)
75                                if (( $#cmd == 1 )); then
76                                        cmd=(builtin jobs -l %+)
77                                else
78                                        cmd=(builtin jobs -l $cmd[2])
79                                fi
80                                ;;
81                        %*)
82                                cmd=(builtin jobs -l $cmd[1])
83                                ;;
84                        cd)
85                                if (( $#cmd == 2)); then
86                                        cmd[1]=$cmd[2]
87                                fi
88                                ;&
89                        *)
90                                echo -n "k$cmd[1]:t\\"
91                                return
92                                ;;
93                esac
94
95                local -A jt; jt=(${(kv)jobtexts})
96
97                $cmd >>(read num rest
98                        cmd=(${(z)${(e):-\$jt$num}})
99                        echo -n "k$cmd[1]:t\\") 2>/dev/null
100        }
101        chpwd
102fi
Note: See TracBrowser for help on using the browser.