Skip to content

Instantly share code, notes, and snippets.

@neiraza
Created April 11, 2012 10:52
Show Gist options
  • Save neiraza/2358608 to your computer and use it in GitHub Desktop.
Save neiraza/2358608 to your computer and use it in GitHub Desktop.
会社の.zshrc
# 標準の補完設定
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
#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-117.105
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%{%}%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