Skip to content

Instantly share code, notes, and snippets.

@neiraza
Created January 20, 2012 01:13
Show Gist options
  • Save neiraza/1644210 to your computer and use it in GitHub Desktop.
Save neiraza/1644210 to your computer and use it in GitHub Desktop.
Zshの設定とか2
# 標準の補完設定
autoload -U compinit
compinit
autoload -Uz add-zsh-hook
autoload -Uz colors
colors
autoload -Uz vcs_info
# 補完をつめて表示
setopt list_packed
# 履歴
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt hist_ignore_dups # ignore duplication command history list
setopt share_history # share command history data
# viライクなキーバインド設定
bindkey -v
# 履歴検索機能のショートカット設定
autoload history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
bindkey "" history-beginning-search-backward-end
bindkey "" history-beginning-search-forward-end
bindkey "" backward-delete-char
# cd省略
setopt auto_cd
# cd記憶
setopt auto_pushd
# コマンド間違ってもおしえてあげる
setopt correct
# encoding
export LANG=ja_JP.UTF-8
#
alias list
alias mysql="mysql --pager='less -S'"
# color
#local gray=$'%{\e[0;30m%}'
#local red=$'%{\e[0;31m%}' # 赤色
#local green=$'%{\e[0;32m%}' # 緑色
#local yellow=$'%{\e[0;33m%}' # 黄色
#local blue=$'%{\e[0;34m%}' # 青色
#local purple=$'%{\e[0;35m%}' # 紫色
#local light_blue=$'%{\e[0;36m%}' # 水色
#local white=$'%{\e[0;37m%}' # 白色
#local GRAY=$'%{\e[1;30m%}'
#local RED=$'%{\e[1;31m%}' # 赤色
#local GREEN=$'%{\e[1;32m%}' # 緑色
#local YELLOW=$'%{\e[1;33m%}' # 黄色
#local BLUE=$'%{\e[1;34m%}' # 青色
#local PURPLE=$'%{\e[1;35m%}' # 紫色
#local LIGHT_BLUE=$'%{\e[1;36m%}' # 水色
#local WHITE=$'%{\e[1;37m%}' # 白色
#local DEFAULT=$white # 標準の色
#User specific aliases and functions
export JAVA_HOME=/usr/java/default
export CLASS_PATH=$JAVA_HOME/lib/tools.jar
#export GROOVY_HOME=$HOME/dev/groovy
export SCALA_HOME=$HOME/dev/scala
export STS_HOME=$HOME/dev/spring-2.8.0/sts
export MAVEN_HOME=/usr/share/maven
export M2_HOME=/usr/share/maven
export ANDROID_HOME=$HOME/dev/android-sdk
export VIMRC=$HOME/.vimrc
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin:$SCALA_HOME/bin:$STS_HOME:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$MAVEN_HOME/bin:$M_HOME/bin
export PATH
export IDEA_HOME=$HOME/dev/idea-IC-111.69
export PATH=$PATH:$IDEA_HOME/bin
export GRADLE_HOME=$HOME/dev/gradle
export PATH=$PATH:$GRADLE_HOME/bin
zstyle ':vcs_info:*' enable git svn hg bzr
zstyle ':vcs_info:*' formats '(%s)-[%b]'
zstyle ':vcs_info:*' actionformats '(%s)-[%b|%a]'
zstyle ':vcs_info:(svn|bzr):*' branchformat '%b:r%r'
zstyle ':vcs_info:bzr:*' use-simple true
autoload -Uz is-at-least
if is-at-least 4.3.10; then
zstyle ':vcs_info:git:*' check-for-changes true
zstyle ':vcs_info:git:*' stagedstr "+"
zstyle ':vcs_info:git:*' unstagedstr "-"
zstyle ':vcs_info:git:*' formats '(%s)-[%b] %c%u'
zstyle ':vcs_info:git:*' actionformats '(%s)-[%b|%a] %c%u'
fi
function _update_vcs_info_msg() {
psvar=()
LANG=en_US.UTF-8 vcs_info
[[ -n "$vcs_info_msg_0_" ]] && psvar[1]="$vcs_info_msg_0_"
}
add-zsh-hook precmd _update_vcs_info_msg
# プロンプト設定
setopt prompt_subst
setopt transient_rprompt
PROMPT="%B%{%}%W %T%{m%}%b %B%{%}%/#%{m%}%b
%B%{%}%#%{m%}%b "
RPROMPT="%B%1(v|%F{cyan}%1v%f|) "
PROMPT2="%B%{%}%_#%{m%}%b "
RPROMPT2="%B%{%}%/#%{m%}%b "
SPROMPT="%B%{^[[1;35m%}%r is correct? [n,y,a,e]:%{^[m%}%b "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment