Last active
August 29, 2015 14:15
-
-
Save kikuchy/e67dd633265bfc86873e to your computer and use it in GitHub Desktop.
ZshCompletionsとかインストール済みのところでしか動かしたことがないので、なかったら自分で入れること
This file contains 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
# aliases | |
alias ls='ls -G' | |
alias vim=/Applications/MacVim.app/Contents/MacOS/Vim | |
alias gvim='env LANG=ja_JP.UTF-8 open -a /Applications/MacVim.app "$@"' | |
alias ctags='/Applications/MacVim.app/Contents/MacOS/ctags "$@"' | |
alias g='git ' | |
alias -g B='`git branch -a | peco --prompt "GIT BRANCH>" | head -n 1 | sed -e "s/^\*\s*//g"`' | |
alias -g R='`git remote | peco --prompt "GIT REMOTE>" | head -n 1`' | |
alias -g S='`git log --date=short --pretty="format:%h %cd %an%d %s" | peco --prompt "GIT SHA1>" | head -n 1 | sed "s/^\([0-9a-f]*\).*/\1/"`' | |
alias -g D='`echo S | sed "s/\([0-9a-f]*\)/\1..\1^/" | xargs git diff --name-only | peco --prompt "GIT DIFF FILE>" | head -n 1 | sed "s/^\(\S*\).*/\1/"`' | |
alias -g LR='`git branch -a | peco --query "remotes/ " --prompt "GIT REMOTE BRANCH>" | head -n 1 | sed "s/^\*\s*//" | sed "s/remotes\/\([^\/]*\)\/\(.*\)/\2 \1\/\2/"`' | |
alias -g C='`git rev-parse --abbrev-ref HEAD`' | |
alias tail='multitail' | |
alias ts='tig status' | |
# 左プロンプト | |
PS1='${USER} %1~ %(!.#.$) ' | |
# 今アクティブな行にだけ右プロンプトを表示 | |
setopt TRANSIENT_RPROMPT | |
# 右プロンプト設定 | |
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_" | |
} | |
RPROMPT="%1(v|%F{green}%1v%f|)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment