Skip to content

Instantly share code, notes, and snippets.

@ichikaway
Created August 8, 2012 00:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ichikaway/3291004 to your computer and use it in GitHub Desktop.
Save ichikaway/3291004 to your computer and use it in GitHub Desktop.
put current branch name on input cursor(need bash version 4)
bind -x '"\C-o": READLINE_LINE="${READLINE_LINE:0:$READLINE_POINT}
`git symbolic-ref HEAD | cut -d/ -f 3` ${READLINE_LINE:${READLINE_POINT}}"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment