Created
May 13, 2010 12:17
-
-
Save yono/399765 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################## | |
# .zshrc | |
# UTF-8 | |
# | |
# gisty | |
export GISTY_DIR="$HOME/github/gists" | |
# mercurial | |
export HGENCODING=UTF-8 | |
export HGEDITOR=vim | |
#文字コードの設定 | |
export LANG=ja_JP.UTF-8 | |
export LC_ALL=ja_JP.UTF-8 | |
#パスの設定 | |
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin | |
PATH=/usr/local/bin:$PATH | |
PATH=.:$PATH | |
PATH=~/bin:$PATH | |
PATH=$PATH:/usr/local/mysql/bin | |
export MANPATH=/usr/local/man:/usr/share/man | |
export PKG_CONFIG_PATH=/usr/lib/pkgconfig | |
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH | |
export LD_LIBRARY_PATH=/usr/local/lib | |
bindkey -e #emacslikeのキーバインドを有効に | |
#関数 | |
find-grep () { find . -type f -print | xargs grep -n --binary-files=without-mati $@ } | |
alias ls="ls --color -F" | |
alias ll="ls -l" | |
alias la="ls -a" | |
# Java | |
alias javac='javac -J-Dfile.encoding=UTF8' | |
alias java='java -Dfile.encoding=UTF8' | |
#ヒストリの設定 | |
HISTFILE=~/.histfile | |
HISTSIZE=100000 | |
SAVEHIST=100000 | |
#履歴ファイルに時刻を記録 | |
setopt extended_history | |
#補完するかの質問は画面を超える時にのみ行う。 | |
LISTMAX=0 | |
#sudo でも補完の対象 | |
zstyle ':complition:*:sudo:*' command-path /opt/local/bin/ /usr/local/sbin /usr/local/bin /usr /sbin /usr/bin /sbin /bin | |
#autoload | |
autoload -U zmv | |
autoload -U compinit ; compinit | |
autoload -U colors ; colors | |
#複数のzshを同時に使う時など historyファイルに上書きせず追加 | |
setopt append_history | |
#補完キー(Tab, Ctrl+I)を連打するだけで順に補完候補を自動で補完 | |
setopt auto_menu autolist correct nobeep nonomatch | |
setopt listtypes pushdsilent | |
#カッコの対応などを自動的に補完 | |
setopt auto_param_keys | |
#ディレクトリ名の補完で末尾の / を自動的に不可し、次の補完に備える | |
setopt auto_param_slash | |
#ビープ音を鳴らさないようにする | |
setopt No_beep | |
#直前と同じコマンドラインはヒストリに追加しない | |
setopt hist_ignore_dups | |
#重複したヒストリは追加しない | |
setopt hist_ignore_all_dups | |
#ヒストリを呼び出してから実行する間に一旦編集できる状態になる | |
setopt hist_verify | |
#auto_list の補完候補一覧で、ls -Fのようにファイルの種別をマーク表示する | |
setopt list_types | |
#コマンドラインの引数で --prefix=/usrなどの = 以降でも補完できる | |
setopt magic_equal_subst | |
#ファイル名の展開でディレクトリにマッチした場合、尾に/を不可する | |
setopt mark_dirs | |
#8ビット目を通すようになり、日本語のファイル名を表示可能に | |
setopt print_eightbit | |
#シェルのプロセスごとに履歴を共有 | |
setopt share_history | |
#Ctrl+wで直前の/までを削除する | |
WORDCHARS='*?_-.[]~=&;!#$%^(){}<>' | |
#ディレクトリを水色にする | |
export LS_COLORS='di=01;36' | |
#ファイルリスト補完でもlsと同様に色をつける | |
zstyle ':completion:*' list-colors di=34 fi=0 | |
#補完リストを矢印キーで選択 | |
zstyle ':completion:*:default' menu select true | |
#cd をしたときにlsを実行する | |
function cd() { | |
builtin cd $@ &&ls; | |
} | |
#COLOR | |
DEFAULT=$'%{\e[0;m%}' | |
GREEN=$'%{\e[1;32m%}' | |
YELLOW=$'%{\e[1;33m%}' | |
BLUE=$'%{\e[1;34m%}' | |
PURPLE=$'%{\e[1;34m%}' | |
RED=$'%{\e[1;31m%}' | |
BLACK=$'{%{\e[1;30m%}' | |
#プロンプト設定 | |
unsetopt promptcr # 改行のない出力をプロンプトで上書きするのを防ぐ | |
setopt prompt_subst | |
if [ $TERM = 'xterm' ]; then | |
PROMPT='${USER}@%m ${WINDOW:+"[$WINDOW]"}%% ' | |
RPROMPT='[%~]' | |
else | |
PROMPT='${USER}@%m%(!.#.%%)${DEFAULT} ' | |
RPROMPT='${BLUE}[%~]${DEFAULT}' | |
fi | |
function ssh_screen(){ | |
eval server=\${$#} | |
screen -t $server ssh "$@" | |
} | |
compctl -k _cache_hosts ssh_screen | |
alias ssh=ssh_screen | |
### time | |
REPORTTIME=8 | |
TIMEFMT="\ | |
The name of this job. :%J | |
CPU seconds spent in user mode. :%U | |
CPU seconds spent in kernel mode. :%S | |
Elapsed time in seconds. :%E | |
The CPU percentage. :%P" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment