Created
January 9, 2012 12:54
-
-
Save clauswitt/1582827 to your computer and use it in GitHub Desktop.
Zsh function to git add last parameter of last command
This file contains hidden or 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
| alias c='git commit ' | |
| alias gd='git diff ' | |
| gal() { | |
| last_command=$history[$[HISTCMD-1]]; | |
| last_command_array=("${(s/ /)last_command}") | |
| echo $last_command_array[-1]; | |
| git add $last_command_array[-1]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment