Vim-fugitive

From ScorecWiki

Jump to: navigation, search

The fugitive vim plugin supports visual diffs of files tracked by Git. This is one of many useful functions it provides.

The github page for fugitive is here:

Contents

first install vim-pathogen for plugins

Github page: https://github.com/tpope/vim-pathogen

Run the following commands to install vim-pathogen:

On SCOREC

 mkdir -p ~/.vim/autoload ~/.vim/bundle && \
 curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

On CCI

 mkdir -p ~/.vim/autoload ~/.vim/bundle
 git clone https://github.com/tpope/vim-pathogen.git
 cp vim-pathogen/autoload/pathogen.vim  ~/.vim/autoload/.

edit your ~/.vimrc

Add the following lines to your `~/.vimrc` file:

 execute pathogen#infect()
 syntax on
 filetype plugin indent on

install vim-fugitive

GitHub page: https://github.com/tpope/vim-fugitive

Run the following commands to install vim-fugitive:

 cd ~/.vim/bundle && \
 git clone https://github.com/tpope/vim-fugitive.git

test the install

 vi ~/.vim/bundle/fugitive/README.markdown

Add a few blank lines then run the following command in vim: :Gdiff

A visual diff should appear.

Tutorials

Tutorials are available here:

https://github.com/tpope/vim-fugitive#screencasts

This tutorial discusses resolving git conflicts using :Gdiff

http://vimcasts.org/episodes/fugitive-vim-resolving-merge-conflicts-with-vimdiff/

Personal tools