Posted on

Tips for using the Fugitive VIM plugin with GIT

Fugitive

Fugitive Vim Plugin for Git

Fugitive is the premier plugin for both Vim and Git. It is so impressive that it should be illegal, which is why it is called Fugitive.

The command :Git (or just :G) is the crown jewel of Fugitive. It is used to call any arbitrary Git command, making it similar to :!git with numerous improvements. For example, :Git commit, :Git rebase -i, and other commands that invoke an editor will do their editing in the current Vim instance, and :Git diff, :Git log, and other verbose commands will have their output loaded into a temporary buffer. Other commands such as :Gedit, :Gdiffsplit, :Gread, :Gwrite, :Ggrep, :Glgrep, :GMove, :GRename, :GDelete, :GRemove, and :GBrowse are also available. Adding %{FugitiveStatusline()} to ‘statusline’ will display an indicator with the current branch in the user’s statusline. For more information, consult the help doc at :help fugitive.