Skip to content

Instantly share code, notes, and snippets.

@kubo39
Forked from anonymous/kubo-zsh.zsh
Last active August 29, 2015 14:17
Show Gist options
  • Save kubo39/f05554a2294699fb0a9a to your computer and use it in GitHub Desktop.
Save kubo39/f05554a2294699fb0a9a to your computer and use it in GitHub Desktop.
# emacsキーバインドを使用
bindkey -e
setopt ignore_eof
# 補完
setopt COMPLETE_IN_WORD
# コピペ時PROMPTを消す
setopt TRANSIENT_RPROMPT
# BEEPを消す
setopt NO_BEEP
autoload -U colors; colors
autoload -U compinit; compinit
zstyle ':completion:*:default' menu select=1
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
# Prompt {{{
setopt PROMPT_SUBST
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:git:*' check-for-changes true
zstyle ':vcs_info:git:*' stagedstr "+"
zstyle ':vcs_info:git:*' unstagedstr "-"
zstyle ':vcs_info:*' formats '[%b%m%u%c]'
zstyle ':vcs_info:*' actionformats '[%b|%a]'
precmd () {
psvar=()
LANG=en_US.UTF-8 vcs_info
[[ -n "$vcs_info_msg_0_" ]] && psvar[1]="$vcs_info_msg_0_"
DEFAULT=$'%F{green}[%D{%m/%d %T}]%f → '
ERROR=$'%F{red}[%D{%m/%d %T}]%f → '
PROMPT=$'%(?.${DEFAULT}.${ERROR}) '
RPROMPT="%1(v|%F{red}%1v%f|) %F{cyan}%d%f %F{magenta}%n%f"
}
# }}}
ZSH_SYNTAX_HIGHLIGHTING_PATH="$HOME/.zsh-syntax-highlighting"
if [ -d "$ZSH_SYNTAX_HIGHLIGHTING_PATH" ]; then
source "$ZSH_SYNTAX_HIGHLIGHTING_PATH/zsh-syntax-highlighting.zsh"
fi
# History {{{
HISTFILE=~/.zsh_history
HISTSIZE=100000000
SAVEHIST=${HISTSIZE}
setopt hist_ignore_dups
setopt hist_ignore_space
setopt share_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
# }}}
ZSH_COMPLETIONS=/usr/local/share/zsh-completions
if [ -d $ZSH_COMPLETIONS ]; then
fpath=("$ZSH_COMPLETIONS/src" $fpath)
fi
if [ -r ~/.zshrc.local ]; then
. ~/.zshrc.local
fi
# vim: fdm=marker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment