explaingit

tpope/vim-fugitive

Analysis updated 2026-06-21

21,585Vim ScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

A Vim plugin that brings full Git integration into your editor so you can stage changes, write commit messages, browse history, and view diffs without ever leaving Vim.

Mindmap

mindmap
  root((vim-fugitive))
    What it does
      Git inside Vim
      No terminal switching
    Key commands
      Stage and commit
      Side by side diff
      File history view
    Features
      GitHub link opener
      Scrollable log buffers
      Commit message editor
    Audience
      Vim power users
      Terminal developers
    Tech
      Vim Script
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Stage specific lines or hunks in a file and write a commit message without leaving Vim.

USE CASE 2

View the Git log or blame for any file directly in a Vim split window.

USE CASE 3

Compare the working copy of a file against its staged version in a side-by-side diff inside Vim.

USE CASE 4

Open the current file on GitHub or GitLab from within Vim to share a direct link.

What is it built with?

Vim Script

How does it compare?

tpope/vim-fugitivewsdjeg/spacevimpreservim/nerdtree
Stars21,58520,27120,074
LanguageVim ScriptVim ScriptVim Script
Setup difficultyeasyeasyeasy
Complexity2/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min
Follows the same license as Vim itself, which is a GPL-compatible open license that includes a charitable giving request.

In plain English

vim-fugitive is a plugin for Vim, a terminal-based text editor, that integrates Git version control directly into the editor. Rather than switching to a separate terminal window to run Git commands, this plugin lets you run them from within Vim itself, with the results displayed sensibly inside the editor's interface. The core feature is the :Git command (also shortened to :G), which lets you run any standard Git command you already know. Beyond simply passing commands through, the plugin adds thoughtful behavior on top: quiet commands like git add run without interrupting your workflow, commands that need a text editor (like writing a commit message) open inside your current Vim session rather than launching a separate editor, and output-heavy commands like git log or git diff load into scrollable temporary buffers you can browse. A set of higher-level commands rounds out the feature set. You can view any historical version of a file, compare the working copy against the staged (ready-to-commit) version side by side, read an old version of a file back into the buffer, move or rename files through Git while keeping Vim in sync, and open the current file on platforms like GitHub or GitLab directly from the editor. You would use vim-fugitive if you live in Vim and want to manage Git without leaving the editor. It is especially useful for reviewing diffs, staging specific changes, writing commit messages, and exploring file history, all without context-switching to a terminal. It is written in Vim Script and follows Vim's own license terms.

Copy-paste prompts

Prompt 1
I just installed vim-fugitive. Walk me through staging specific lines of a file and writing a commit message, all from inside Vim using fugitive commands.
Prompt 2
Using vim-fugitive, show me how to open a side-by-side diff between my working copy and the staged version of a file.
Prompt 3
How do I use vim-fugitive to browse the Git log for a file and temporarily check out an older version of it?
Prompt 4
What vim-fugitive command opens the file I am currently editing directly on GitHub in my browser?

Frequently asked questions

What is vim-fugitive?

A Vim plugin that brings full Git integration into your editor so you can stage changes, write commit messages, browse history, and view diffs without ever leaving Vim.

What language is vim-fugitive written in?

Mainly Vim Script. The stack also includes Vim Script.

What license does vim-fugitive use?

Follows the same license as Vim itself, which is a GPL-compatible open license that includes a charitable giving request.

How hard is vim-fugitive to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is vim-fugitive for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub tpope on gitmyhub

Verify against the repo before relying on details.