tpope / vim-fugitive

fugitive.vim: A Git wrapper so awesome, it should be illegal
https://www.vim.org/scripts/script.php?script_id=2975
19.82k stars 1k forks source link

fugitive.vim

Fugitive is the premier Vim plugin for Git. Or maybe it's the premier Git plugin for Vim? Either way, it's "so awesome, it should be illegal". That's why it's called Fugitive.

The crown jewel of Fugitive is :Git (or just :G), which calls any arbitrary Git command. If you know how to use Git at the command line, you know how to use :Git. It's vaguely akin to :!git but with numerous improvements:

Additional commands are provided for higher level operations:

Add %{FugitiveStatusline()} to 'statusline' to get an indicator with the current branch in your statusline.

For more information, see :help fugitive.

Screencasts

Installation

Install using your favorite package manager, or use Vim's built-in package support:

mkdir -p ~/.vim/pack/tpope/start
cd ~/.vim/pack/tpope/start
git clone https://tpope.io/vim/fugitive.git
vim -u NONE -c "helptags fugitive/doc" -c q

FAQ

What happened to the dispatch.vim backed asynchronous :Gpush and :Gfetch?

This behavior was divisive, confusing, and complicated inputting passwords, so it was removed. Use :Git! push to use Fugitive's own asynchronous execution, or retroactively make :Git push asynchronous by pressing CTRL-D.

Why am I getting core.worktree is required when using an external Git dir?

Git generally sets core.worktree for you automatically when necessary, but if you're doing something weird, or using a third-party tool that does something weird, you may need to set it manually:

git config core.worktree "$PWD"

This may be necessary even when simple git commands seem to work fine without it.

So I have a symlink and...

Stop. Just stop. If Git won't deal with your symlink, then Fugitive won't either. Consider using a plugin that resolves symlinks, or even better, using fewer symlinks.

Self-Promotion

Like fugitive.vim? Follow the repository on GitHub and vote for it on vim.org. And if you're feeling especially charitable, follow tpope on Twitter and GitHub.

License

Copyright (c) Tim Pope. Distributed under the same terms as Vim itself. See :help license.