TIP: my GIT+VIM visual commit shortcut
I just got asked by someone about this so I figured I’d share with everyone :D
Do you write any type of structured text (code, technical documentation, etc)? Do you use GIT? Do you work in VIM in a terminal?
If not, you should really look into it. VIM == life changing editor.
If you do, here’s a great little utility function to view the changes you’re about commit while you’re writing your commit message
commit() {
git diff $* > /tmp/.git.commit
EDITOR='vim -c "vsp /tmp/.git.commit"' git commit $*
}
Drop the above snippet in your .bashrc file and then you can simply invoke commit from your shell with the list of items you want to commit as the arguments and you’ll end up with something like the following.
