Git wrapper for vim: fugitive.vimPosted: May 14, 2014 | Author: ThomasPowell | Filed under: Uncategorized | Leave a comment »
Today’s browsing through “plugins that I haven’t made good enough use of” brings me to vim-fugitive:
:Gstatus pulls git status output into a vim split window. Pressing
- on the line that a file is listed on either adds or removes a file from staging, and
:Gcommit commits it.
:Gdiff opens a vertical split next to a file and uses vim’s diff facility to compare working copy to staged version.
:Gblame opens a vertical split next to a file with an interactive git blame output that tracks the source file as you scroll. Pressing
on a line opens the commit that changed the code (or
o to open in a split.)
:Glog opens the log in the quickfix window:
:copento open the quickfix window to scroll through the versions
:cclclose the quickfix window
:cngo to the next error in the quickfix window (append a number to jump # steps)
:cpgo to the previous error in the quickfix window (append a number to jump # steps)
:Gmove performs a
git mv and modifies the buffer location as well.
:Gremove performs a
git rm and removes the buffer as well.
Other commands of interest that I haven’t considered for my current workflow:
:Git performs any other git command not already covered.
:Gtabedit appear to open a repository object directly… not quite ready to pick at individual objects on that level.