description | none |
repository URL | https://github.com/tpope/vim-fugitive.git |
owner | stefan.naewe+rr@gmail.com |
last change | Tue, 19 Nov 2024 17:16:44 +0000 (19 12:16 -0500) |
last refresh | Thu, 21 Nov 2024 08:20:57 +0000 (21 09:20 +0100) |
mirror URL | git://repo.or.cz/vim-fugitive.git |
https://repo.or.cz/vim-fugitive.git | |
ssh://git@repo.or.cz/vim-fugitive.git | |
bundle info | vim-fugitive.git downloadable bundles |
content tags |
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:
:Git add
avoid the dreaded "Press ENTER or type command to
continue" prompt.:Git commit
, :Git rebase -i
, and other commands that invoke an editor do
their editing in the current Vim instance.:Git diff
, :Git log
, and other verbose, paginated commands have their
output loaded into a temporary buffer. Force this behavior for any command
with :Git --paginate
or :Git -p
.:Git blame
uses a temporary buffer with maps for additional triage. Press
enter on a line to view the commit where the line changed, or g?
to see
other available maps. Omit the filename argument and the currently edited
file will be blamed in a vertical, scroll-bound split.:Git mergetool
and :Git difftool
load their changesets into the quickfix
list.:Git
opens a summary window with dirty files and
unpushed and unpulled commits. Press g?
to bring up a list of maps for
numerous operations including diffing, staging, committing, rebasing, and
stashing. (This is the successor to the old :Gstatus
.)Additional commands are provided for higher level operations:
:Gedit
(and
:Gsplit
, etc.). For example, :Gedit HEAD~3:%
loads the current file as
it existed 3 commits ago.:Gdiffsplit
(or :Gvdiffsplit
) brings up the staged version of the file
side by side with the working tree version. Use Vim's diff handling
capabilities to apply changes to the staged version, and write that buffer
to stage the changes. You can also give an arbitrary :Gedit
argument to
diff against older versions of the file.:Gread
is a variant of git checkout -- filename
that operates on the
buffer rather than the file itself. This means you can use u
to undo it
and you never get any warnings about the file changing outside Vim.:Gwrite
writes to both the work tree and index versions of a file, making
it like git add
when called from a work tree file and like git checkout
when called from the index or a blob in history.:Ggrep
is :grep
for git grep
. :Glgrep
is :lgrep
for the same.:GMove
does a git mv
on the current file and changes the buffer name to
match. :GRename
does the same with a destination filename relative to the
current file's directory.:GDelete
does a git rm
on the current file and simultaneously deletes
the buffer. :GRemove
does the same but leaves the (now empty) buffer
open.:GBrowse
to open the current file on the web front-end of your favorite
hosting provider, with optional line range (try it in visual mode). Plugins
are available for popular providers such as GitHub,
GitLab, Bitbucket,
Gitee, Pagure,
Phabricator, Azure DevOps,
and sourcehut.Add %{FugitiveStatusline()}
to 'statusline'
to get an indicator
with the current branch in your statusline.
For more information, see :help fugitive
.
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
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.
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.
Copyright (c) Tim Pope. Distributed under the same terms as Vim itself.
See :help license
.
2 years ago | v3.7 | fugitive.vim 3.7 | tag | commitlog |
2 years ago | v3.6 | fugitive.vim 3.6 | tag | commitlog |
3 years ago | v3.5 | fugitive.vim 3.5 | tag | commitlog |
3 years ago | v3.4 | fugitive.vim 3.4 | tag | commitlog |
3 years ago | v3.3 | fugitive.vim 3.3 | tag | commitlog |
4 years ago | v3.2 | fugitive.vim 3.2 | tag | commitlog |
5 years ago | v3.1 | fugitive.vim 3.1 | tag | commitlog |
5 years ago | v3.0 | fugitive.vim 3.0 | tag | commitlog |
6 years ago | v2.5 | fugitive.vim 2.5 | tag | commitlog |
6 years ago | v2.4 | fugitive.vim 2.4 | tag | commitlog |
6 years ago | v2.3 | fugitive.vim 2.3 | tag | commitlog |
9 years ago | v2.2 | fugitive.vim 2.2 | tag | commitlog |
10 years ago | v2.1 | fugitive.vim 2.1 | tag | commitlog |
10 years ago | v2.0 | fugitive.vim 2.0 | tag | commitlog |
13 years ago | v1.2 | fugitive.vim 1.2 | tag | commitlog |
14 years ago | v1.1 | fugitive.vim 1.1 | tag | commitlog |
... |
39 hours ago | master | logtree |
3 years ago | double-status | logtree |
3 years ago | parallel-status | logtree |
4 years ago | difftool | logtree |
7 years ago | blame_message | logtree |
8 years ago | worktree | logtree |
8 years ago | nested/test | logtree |
11 years ago | buffer_path | logtree |
12 years ago | http_github_fi | logtree |
12 years ago | blame_color | logtree |
13 years ago | copied | logtree |