mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-10 04:23:46 -05:00
Compare commits
1 Commits
v2.2
...
http_githu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff32149a59 |
@@ -1,18 +0,0 @@
|
|||||||
Before reporting a bug, you should try stripping down your Vim configuration
|
|
||||||
and removing other plugins. The sad truth about VimScript is that it is
|
|
||||||
fraught with incompatibilities waiting to happen. I'm happy to work around
|
|
||||||
them where I can, but it's up to you to isolate the conflict.
|
|
||||||
|
|
||||||
Fugitive is particularly prone to regressions due to Git version issues,
|
|
||||||
platform issues, and interactions with other plugins. I end up bisecting a
|
|
||||||
lot more than other projects, and thus I'm especially meticulous here about
|
|
||||||
maintaining a clean, readable, history. Squash and force push any requested
|
|
||||||
changes to a pull request. And if your [commit message
|
|
||||||
sucks](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html),
|
|
||||||
I'm not going to accept it. Period.
|
|
||||||
|
|
||||||
Beyond that, don't be shy about asking before patching. What takes you hours
|
|
||||||
might take me minutes simply because I have both domain knowledge and a
|
|
||||||
perverse knowledge of VimScript so vast that many would consider it a symptom
|
|
||||||
of mental illness. On the flip side, some ideas I'll reject no matter how
|
|
||||||
good the implementation is. "Send a patch" is an edge case answer in my book.
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
# fugitive.vim
|
fugitive.vim
|
||||||
|
============
|
||||||
|
|
||||||
I'm not going to lie to you; fugitive.vim may very well be the best
|
I'm not going to lie to you; fugitive.vim may very well be the best
|
||||||
Git wrapper of all time. Check out these features:
|
Git wrapper of all time. Check out these features:
|
||||||
@@ -11,13 +12,13 @@ Vim's diff handling capabilities to stage a subset of the file's
|
|||||||
changes.
|
changes.
|
||||||
|
|
||||||
Bring up the output of `git status` with `:Gstatus`. Press `-` to
|
Bring up the output of `git status` with `:Gstatus`. Press `-` to
|
||||||
`add`/`reset` a file's changes, or `p` to `add`/`reset` `--patch`. And guess
|
`add`/`reset` a file's changes, or `p` to `add`/`reset` `--patch` that
|
||||||
what `:Gcommit` does!
|
mofo. And guess what `:Gcommit` does!
|
||||||
|
|
||||||
`:Gblame` brings up an interactive vertical split with `git blame`
|
`:Gblame` brings up an interactive vertical split with `git blame`
|
||||||
output. Press enter on a line to edit the commit where the line
|
output. Press enter on a line to reblame the file as it stood in that
|
||||||
changed, or `o` to open it in a split. When you're done, use `:Gedit`
|
commit, or `o` to open that commit in a split. When you're done, use
|
||||||
in the historic buffer to go back to the work tree version.
|
`:Gedit` in the historic buffer to go back to the work tree version.
|
||||||
|
|
||||||
`:Gmove` does a `git mv` on a file and simultaneously renames the
|
`:Gmove` does a `git mv` on a file and simultaneously renames the
|
||||||
buffer. `:Gremove` does a `git rm` on a file and simultaneously deletes
|
buffer. `:Gremove` does a `git rm` on a file and simultaneously deletes
|
||||||
@@ -45,7 +46,8 @@ with the current branch in (surprise!) your statusline.
|
|||||||
Last but not least, there's `:Git` for running any arbitrary command,
|
Last but not least, there's `:Git` for running any arbitrary command,
|
||||||
and `Git!` to open the output of a command in a temp file.
|
and `Git!` to open the output of a command in a temp file.
|
||||||
|
|
||||||
## Screencasts
|
Screencasts
|
||||||
|
-----------
|
||||||
|
|
||||||
* [A complement to command line git](http://vimcasts.org/e/31)
|
* [A complement to command line git](http://vimcasts.org/e/31)
|
||||||
* [Working with the git index](http://vimcasts.org/e/32)
|
* [Working with the git index](http://vimcasts.org/e/32)
|
||||||
@@ -53,21 +55,25 @@ and `Git!` to open the output of a command in a temp file.
|
|||||||
* [Browsing the git object database](http://vimcasts.org/e/34)
|
* [Browsing the git object database](http://vimcasts.org/e/34)
|
||||||
* [Exploring the history of a git repository](http://vimcasts.org/e/35)
|
* [Exploring the history of a git repository](http://vimcasts.org/e/35)
|
||||||
|
|
||||||
## Installation
|
Installation
|
||||||
|
------------
|
||||||
|
|
||||||
If you don't have a preferred installation method, one option is to install
|
If you don't have a preferred installation method, I recommend
|
||||||
[pathogen.vim](https://github.com/tpope/vim-pathogen), and then copy
|
installing [pathogen.vim](https://github.com/tpope/vim-pathogen), and
|
||||||
and paste:
|
then simply copy and paste:
|
||||||
|
|
||||||
cd ~/.vim/bundle
|
cd ~/.vim/bundle
|
||||||
git clone git://github.com/tpope/vim-fugitive.git
|
git clone git://github.com/tpope/vim-fugitive.git
|
||||||
vim -u NONE -c "helptags vim-fugitive/doc" -c q
|
|
||||||
|
Once help tags have been generated, you can view the manual with
|
||||||
|
`:help fugitive`.
|
||||||
|
|
||||||
If your Vim version is below 7.2, I recommend also installing
|
If your Vim version is below 7.2, I recommend also installing
|
||||||
[vim-git](https://github.com/tpope/vim-git) for syntax highlighting and
|
[vim-git](https://github.com/tpope/vim-git) for syntax highlighting and
|
||||||
other Git niceties.
|
other Git niceties.
|
||||||
|
|
||||||
## FAQ
|
FAQ
|
||||||
|
---
|
||||||
|
|
||||||
> I installed the plugin and started Vim. Why don't any of the commands
|
> I installed the plugin and started Vim. Why don't any of the commands
|
||||||
> exist?
|
> exist?
|
||||||
@@ -103,7 +109,32 @@ to open after any grep invocation:
|
|||||||
|
|
||||||
autocmd QuickFixCmdPost *grep* cwindow
|
autocmd QuickFixCmdPost *grep* cwindow
|
||||||
|
|
||||||
## Self-Promotion
|
Contributing
|
||||||
|
------------
|
||||||
|
|
||||||
|
Before reporting a bug, you should try stripping down your Vim
|
||||||
|
configuration and removing other plugins. The sad nature of VimScript
|
||||||
|
is that it is fraught with incompatibilities waiting to happen. I'm
|
||||||
|
happy to work around them where I can, but it's up to you to isolate
|
||||||
|
the conflict.
|
||||||
|
|
||||||
|
If your [commit message sucks](http://stopwritingramblingcommitmessages.com/),
|
||||||
|
I'm not going to accept your pull request. I've explained very politely
|
||||||
|
dozens of times that
|
||||||
|
[my general guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
|
||||||
|
are absolute rules on my own repositories, so I may lack the energy to
|
||||||
|
explain it to you yet another time. And please, if I ask you to change
|
||||||
|
something, `git commit --amend`.
|
||||||
|
|
||||||
|
Beyond that, don't be shy about asking before patching. What takes you
|
||||||
|
hours might take me minutes simply because I have both domain knowledge
|
||||||
|
and a perverse knowledge of VimScript so vast that many would consider
|
||||||
|
it a symptom of mental illness. On the flip side, some ideas I'll
|
||||||
|
reject no matter how good the implementation is. "Send a patch" is an
|
||||||
|
edge case answer in my book.
|
||||||
|
|
||||||
|
Self-Promotion
|
||||||
|
--------------
|
||||||
|
|
||||||
Like fugitive.vim? Follow the repository on
|
Like fugitive.vim? Follow the repository on
|
||||||
[GitHub](https://github.com/tpope/vim-fugitive) and vote for it on
|
[GitHub](https://github.com/tpope/vim-fugitive) and vote for it on
|
||||||
@@ -112,7 +143,8 @@ you're feeling especially charitable, follow [tpope](http://tpo.pe/) on
|
|||||||
[Twitter](http://twitter.com/tpope) and
|
[Twitter](http://twitter.com/tpope) and
|
||||||
[GitHub](https://github.com/tpope).
|
[GitHub](https://github.com/tpope).
|
||||||
|
|
||||||
## License
|
License
|
||||||
|
-------
|
||||||
|
|
||||||
Copyright (c) Tim Pope. Distributed under the same terms as Vim itself.
|
Copyright (c) Tim Pope. Distributed under the same terms as Vim itself.
|
||||||
See `:help license`.
|
See `:help license`.
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ that are part of Git repositories).
|
|||||||
window. The following maps, which work on the cursor
|
window. The following maps, which work on the cursor
|
||||||
line file where sensible, are provided:
|
line file where sensible, are provided:
|
||||||
|
|
||||||
g? show this help
|
|
||||||
<C-N> next file
|
<C-N> next file
|
||||||
<C-P> previous file
|
<C-P> previous file
|
||||||
<CR> |:Gedit|
|
<CR> |:Gedit|
|
||||||
@@ -55,7 +54,7 @@ that are part of Git repositories).
|
|||||||
p |:Git| add --patch
|
p |:Git| add --patch
|
||||||
p |:Git| reset --patch (staged files)
|
p |:Git| reset --patch (staged files)
|
||||||
q close status
|
q close status
|
||||||
r reload status
|
R reload status
|
||||||
S |:Gvsplit|
|
S |:Gvsplit|
|
||||||
|
|
||||||
*fugitive-:Gcommit*
|
*fugitive-:Gcommit*
|
||||||
@@ -63,32 +62,12 @@ that are part of Git repositories).
|
|||||||
to commit, |:Gstatus| is called instead. Unless the
|
to commit, |:Gstatus| is called instead. Unless the
|
||||||
arguments given would skip the invocation of an editor
|
arguments given would skip the invocation of an editor
|
||||||
(e.g., -m), a split window will be used to obtain a
|
(e.g., -m), a split window will be used to obtain a
|
||||||
commit message, or a new tab if -v is given. Write
|
commit message. Write and close that window (:wq or
|
||||||
and close that window (:wq or |:Gwrite|) to finish the
|
|:Gwrite|) to finish the commit. Unlike when running
|
||||||
commit. Unlike when running the actual git-commit
|
the actual git-commit command, it is possible (but
|
||||||
command, it is possible (but unadvisable) to alter the
|
unadvisable) to muck with the index with commands like
|
||||||
index with commands like git-add and git-reset while a
|
git-add and git-reset while a commit message is
|
||||||
commit message is pending.
|
pending.
|
||||||
|
|
||||||
*fugitive-:Gmerge*
|
|
||||||
:Gmerge [args] Calls git-merge and loads errors and conflicted files
|
|
||||||
into the quickfix list. Opens a |:Gcommit| style
|
|
||||||
split window for the commit message if the merge
|
|
||||||
succeeds. If called during a merge conflict, the
|
|
||||||
conflicted files from the current index are loaded
|
|
||||||
into the quickfix list.
|
|
||||||
|
|
||||||
*fugitive-:Gpull*
|
|
||||||
:Gpull [args] Like |:Gmerge|, but for git-pull.
|
|
||||||
|
|
||||||
*fugitive-:Gpush*
|
|
||||||
:Gpush [args] Invoke git-push, load the results into the quickfix
|
|
||||||
list, and invoke |:cwindow| to reveal any errors.
|
|
||||||
|:Dispatch| is used if available for asynchronous
|
|
||||||
invocation.
|
|
||||||
|
|
||||||
*fugitive-:Gfetch*
|
|
||||||
:Gfetch [args] Like |:Gpush|, but for git-fetch.
|
|
||||||
|
|
||||||
*fugitive-:Ggrep*
|
*fugitive-:Ggrep*
|
||||||
:Ggrep [args] |:grep| with git-grep as 'grepprg'.
|
:Ggrep [args] |:grep| with git-grep as 'grepprg'.
|
||||||
@@ -104,11 +83,6 @@ that are part of Git repositories).
|
|||||||
previous commits rather than previous file revisions
|
previous commits rather than previous file revisions
|
||||||
are loaded.
|
are loaded.
|
||||||
|
|
||||||
:{range}Glog [args] Use git-log -L to load previous revisions of the given
|
|
||||||
range of the current file into the quickfix list. The
|
|
||||||
cursor is positioned on the first line of the first
|
|
||||||
diff hunk for each commit.
|
|
||||||
|
|
||||||
*fugitive-:Gllog*
|
*fugitive-:Gllog*
|
||||||
:Gllog [args] Like |:Glog|, but use the location list instead of the
|
:Gllog [args] Like |:Glog|, but use the location list instead of the
|
||||||
quickfix list.
|
quickfix list.
|
||||||
@@ -148,7 +122,7 @@ that are part of Git repositories).
|
|||||||
|
|
||||||
:{range}Gread! [args] |:read| the output of a Git command after {range}.
|
:{range}Gread! [args] |:read| the output of a Git command after {range}.
|
||||||
|
|
||||||
*fugitive-:Gw* *fugitive-:Gwrite*
|
*fugitive-:Gwrite*
|
||||||
:Gwrite Write to the current file's path and stage the results.
|
:Gwrite Write to the current file's path and stage the results.
|
||||||
When run in a work tree file, it is effectively git
|
When run in a work tree file, it is effectively git
|
||||||
add. Elsewhere, it is effectively git-checkout. A
|
add. Elsewhere, it is effectively git-checkout. A
|
||||||
@@ -174,16 +148,14 @@ that are part of Git repositories).
|
|||||||
index is used (which means a three-way diff during a
|
index is used (which means a three-way diff during a
|
||||||
merge conflict, making it a git-mergetool
|
merge conflict, making it a git-mergetool
|
||||||
alternative). The newer of the two files is placed
|
alternative). The newer of the two files is placed
|
||||||
to the right or bottom, depending on 'diffopt' and
|
to the right. Use |do| and |dp| and write to the
|
||||||
the width of the window relative to 'textwidth'. Use
|
index file to simulate "git add --patch".
|
||||||
|do| and |dp| and write to the index file to simulate
|
|
||||||
"git add --patch".
|
|
||||||
|
|
||||||
*fugitive-:Gsdiff*
|
*fugitive-:Gsdiff*
|
||||||
:Gsdiff [revision] Like |:Gdiff|, but always split horizontally.
|
:Gsdiff [revision] Like |:Gdiff|, but split horizontally.
|
||||||
|
|
||||||
*fugitive-:Gvdiff*
|
*fugitive-:Gvdiff*
|
||||||
:Gvdiff [revision] Like |:Gdiff|, but always split vertically.
|
:Gvdiff [revision] Identical to |:Gdiff|. For symmetry with |:Gsdiff|.
|
||||||
|
|
||||||
*fugitive-:Gmove*
|
*fugitive-:Gmove*
|
||||||
:Gmove {destination} Wrapper around git-mv that renames the buffer
|
:Gmove {destination} Wrapper around git-mv that renames the buffer
|
||||||
@@ -199,18 +171,18 @@ that are part of Git repositories).
|
|||||||
|
|
||||||
*fugitive-:Gblame*
|
*fugitive-:Gblame*
|
||||||
:Gblame [flags] Run git-blame on the file and open the results in a
|
:Gblame [flags] Run git-blame on the file and open the results in a
|
||||||
scroll bound vertical split. You can give any of
|
scroll bound vertical split. Press enter on a line to
|
||||||
ltfnsewMC as flags and they will be passed along to
|
reblame the file as it was in that commit. You can
|
||||||
git-blame. The following maps, which work on the
|
give any of ltfnsewMC as flags and they will be passed
|
||||||
cursor line commit where sensible, are provided:
|
along to git-blame. The following maps, which work on
|
||||||
|
the cursor line commit where sensible, are provided:
|
||||||
|
|
||||||
g? show this help
|
|
||||||
A resize to end of author column
|
A resize to end of author column
|
||||||
C resize to end of commit column
|
C resize to end of commit column
|
||||||
D resize to end of date/time column
|
D resize to end of date/time column
|
||||||
q close blame and return to blamed window
|
q close blame and return to blamed window
|
||||||
gq q, then |:Gedit| to return to work tree version
|
gq q, then |:Gedit| to return to work tree version
|
||||||
<CR> q, then open commit
|
i q, then open commit
|
||||||
o open commit in horizontal split
|
o open commit in horizontal split
|
||||||
O open commit in new tab
|
O open commit in new tab
|
||||||
- reblame at commit
|
- reblame at commit
|
||||||
@@ -231,7 +203,7 @@ that are part of Git repositories).
|
|||||||
To use with GitHub FI, point g:fugitive_github_domains
|
To use with GitHub FI, point g:fugitive_github_domains
|
||||||
at a list of domains:
|
at a list of domains:
|
||||||
>
|
>
|
||||||
let g:fugitive_github_domains = ['https://example.com']
|
let g:fugitive_github_domains = ['git.example.com']
|
||||||
~
|
~
|
||||||
:[range]Gbrowse! Like :Gbrowse, but put the URL on the clipboard rather
|
:[range]Gbrowse! Like :Gbrowse, but put the URL on the clipboard rather
|
||||||
than opening it.
|
than opening it.
|
||||||
@@ -286,10 +258,6 @@ P Go to the current file in the [count]th parent.
|
|||||||
*fugitive-C*
|
*fugitive-C*
|
||||||
C Go to the commit containing the current file.
|
C Go to the commit containing the current file.
|
||||||
|
|
||||||
*fugitive-.*
|
|
||||||
. Start a |:| command line with the current revision
|
|
||||||
prepopulated at the end of the line.
|
|
||||||
|
|
||||||
*fugitive-a*
|
*fugitive-a*
|
||||||
a Show the current tag, commit, or tree in an alternate
|
a Show the current tag, commit, or tree in an alternate
|
||||||
format.
|
format.
|
||||||
|
|||||||
1017
plugin/fugitive.vim
1017
plugin/fugitive.vim
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user