Cette page est affichée en anglais. Une traduction française est en cours.
ConfigsMay 20, 2026·3 min de lecture

vim-fugitive — Premier Git Plugin for Vim and Neovim

A comprehensive Git wrapper for Vim that lets you run any Git command from inside the editor, stage hunks interactively, browse history, resolve merge conflicts, and push code without leaving your buffer.

Prêt pour agents

Cet actif peut être lu et installé directement par les agents

TokRepo expose une commande CLI universelle, un contrat d'installation, le metadata JSON, un plan selon l'adaptateur et le contenu raw pour aider les agents à juger l'adaptation, le risque et les prochaines actions.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
vim-fugitive
Commande CLI universelle
npx tokrepo install 544ccbc0-53e1-11f1-9bc6-00163e2b0d79

Introduction

vim-fugitive, created by Tim Pope, is the most widely used Git integration plugin for Vim and Neovim. It wraps the entire Git CLI into Vim commands and buffers, so you can stage files, resolve conflicts, browse commit history, and push changes without switching to a terminal. It has been a staple of the Vim ecosystem for over a decade.

What vim-fugitive Does

  • Provides :Git (or :G) as a general-purpose gateway to any Git subcommand from inside Vim
  • Opens an interactive status buffer where you can stage, unstage, and discard changes per hunk
  • Runs :Git blame with inline annotations and lets you press Enter to explore parent commits
  • Displays diffs in Vim buffers with full syntax highlighting and navigation
  • Supports three-way merge conflict resolution through :Gdiffsplit

Architecture Overview

vim-fugitive is a pure Vimscript plugin that communicates with Git through shell invocations. It intercepts Git output and renders it in custom Vim buffers with filetype-specific mappings. The status buffer uses autocmds and buffer-local keybindings to turn s into stage, u into unstage, and = into inline diff toggle. The :GBrowse command (via vim-rhubarb) constructs URLs for GitHub, GitLab, or Bitbucket.

Self-Hosting & Configuration

  • Install via any Vim plugin manager: vim-plug, lazy.nvim, packer, or manual pathogen
  • No configuration is required; it works out of the box with any Git repository
  • Add tpope/vim-rhubarb for GitHub integration with :GBrowse
  • Customize statusline by adding FugitiveStatusline() to your statusline option
  • For Neovim users, fugitive is fully compatible and requires no special setup

Key Features

  • Full Git CLI access through :Git without leaving the editor
  • Interactive staging and unstaging with per-hunk granularity in the status buffer
  • Inline blame annotations with commit navigation
  • Three-way diff split for merge conflict resolution
  • Seamless integration with Vim's quickfix list for git grep and git log results

Comparison with Similar Tools

  • Magit (Emacs) — Similar philosophy but for Emacs; vim-fugitive is the Vim equivalent in popularity and scope
  • Neogit — A Magit-inspired Neovim plugin written in Lua; vim-fugitive is more mature and works in both Vim and Neovim
  • Gitsigns.nvim — Focuses on gutter signs and hunk actions; vim-fugitive covers the full Git workflow
  • lazygit — Terminal UI for Git; vim-fugitive keeps you inside the editor
  • GitUI — Rust-based terminal Git client; vim-fugitive integrates directly into the Vim editing workflow

FAQ

Q: Does vim-fugitive work with Neovim? A: Yes. It is fully compatible with Neovim and requires no additional configuration.

Q: How do I stage individual hunks? A: Open :Git status, navigate to a file, press = to expand the diff inline, then use s on the hunk header to stage it.

Q: Can I use vim-fugitive with GitHub or GitLab? A: Yes. Install vim-rhubarb (GitHub) or vim-flog and fugitive-gitlab (GitLab) to enable :GBrowse for opening files and commits in your browser.

Q: Is vim-fugitive slow on large repositories? A: Performance depends on Git itself. For very large repos, operations like blame and log may take a moment, but fugitive adds minimal overhead.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires