Skip to content

Instantly share code, notes, and snippets.

@amzyang
Created February 11, 2014 13:01
Show Gist options
  • Save amzyang/8934415 to your computer and use it in GitHub Desktop.
Save amzyang/8934415 to your computer and use it in GitHub Desktop.
magic-enter () {
if [[ -z $BUFFER ]]; then
if git rev-parse --is-inside-work-tree > /dev/null 2>&1; then
echo
git diff --minimal
echo
fi
fi
zle accept-line
}
zle -N magic-enter
bindkey "^M" magic-enter
export PAGER="less -F"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment