Skip to content

Instantly share code, notes, and snippets.

@ryoppy
Last active December 22, 2015 15:19
Show Gist options
  • Save ryoppy/6492006 to your computer and use it in GitHub Desktop.
Save ryoppy/6492006 to your computer and use it in GitHub Desktop.
oh-my-zshでstashをpromptに出す
# ~/.oh-my-zsh/custom/git-stash.zsh
function show_git_stash() {
$(git --no-pager log -1 > /dev/null 2>&1)
if [ "$?" -eq 0 ]; then
ZSH_THEME_GIT_PROMPT_SUFFIX="{@${$(git --no-pager stash list 2>/dev/null | wc -l | sed "s/ //g")}}"
else
ZSH_THEME_GIT_PROMPT_SUFFIX=""
fi
}
add-zsh-hook precmd show_git_stash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment