DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Use Git in Vim with fugitive


Install

Add Plugin 'tpope/vim-fugitive' into ~/.vimrc and run vim +PluginClean +PluginInstall +qa.

Get Help

:help fugitive

Frequently Use Commands

Action Name Meaning Close Window with
:Gblame show info of each line q
:Gdiff show diff in vim :q
:Gstatus show git status q

In Gstatus

In ":Gst" window, you can use "-" to add/remove a file in/out stage area, "cc" to commit, "U" to reset (discard local changes), you may need reload the file with :e "dv" to diff in vertical split, "ds" or "D" to diff in horizontal split (:q to quit from diff) "g?" to see all available actions.

To see the file changes history: :Git log --stat.

Working with nerdtree

Add Plugin 'Xuyuanp/nerdtree-git-plugin' into .vimrc.



Published

Oct 5, 2015

Last Updated

Oct 5, 2015

Category

Tech

Tags

  • fugitive 1
  • git 36
  • plugin 16
  • vim 92

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor