View git commit changes in vim
You use git and you write your commit messages in vim.
You like to see the changes you staged while you write your comment.
If that's the case you can add this line to your vimrc
autocmd FileType gitcommit DiffGitCached | wincmd J
That tells vim to run the command DiffGitCached
and wincmd J
when opening the filetype gitcommit
. As you can imagine the DiffGitCached
command opens a buffer to show the git diff --cached
output. wincmd J
is there just to moves the panel on the right-hand side.
Original source Stackoverflow
Written by Alessandro Mecca
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#