Skip to content

Instantly share code, notes, and snippets.

@shnjp
Created April 4, 2011 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shnjp/901536 to your computer and use it in GitHub Desktop.
Save shnjp/901536 to your computer and use it in GitHub Desktop.
ぼくのzshrc. どこから持ってきたんだっけ…
#
autoload -U compinit
autoload -Uz vcs_info
autoload -U colors
colors
compinit
setopt auto_pushd
setopt correct
bindkey -e
export PATH=/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:$PATH
export SVN_EDITOR='mate -w'
# History
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 "^P" history-beginning-search-backward-end
bindkey "^N" history-beginning-search-forward-end
bindkey "^F" forward-word
bindkey "^B" backward-word
HISTFILE=~/.zsh_history
HISTSIZE=65535
SAVEHIST=65535
setopt hist_ignore_dups # ignore duplication command history list
setopt share_history # share command history data
# vcs_info
zstyle ':vcs_info:*' formats '(%b@%r)-[%S]'
zstyle ':vcs_info:*' actionformats '(%s)-[%b|%a]'
# Prompt
precmd () {
psvar=()
LANG=en_US.UTF-8 vcs_info
[[ -n "$vcs_info_msg_0_" ]] && psvar[1]="$vcs_info_msg_0_"
}
PROMPT="%m:%n%% "
#RPROMPT="[%~]"
RPROMPT="%1(v|%1v%f|[%~])"
SPROMPT="correct: %R -> %r ? "
case ${UID} in
0)
PROMPT=`echo "%{\033[31m%}%m:%n%%%{\033[m%} "`
;;
*)
PROMPT=`echo "%{\033[35m%}%m:%n%%%{\033[m%} "`
;;
esac
# alias
alias ls="ls -G"
alias ll="ls -l"
alias la="ls -al"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment