mirror of
https://github.com/tpope/vim-fugitive.git
synced 2026-04-25 00:34:00 +08:00
Compare commits
264 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ff32149a59 | |||
| 003f38c6a4 | |||
| 3f703b6e03 | |||
| 9afeebf32e | |||
| 09743e76a0 | |||
| 14958f37e3 | |||
| 05763df0ed | |||
| f43393dd9a | |||
| daccfb508f | |||
| cdb7bd9841 | |||
| 554909ed4b | |||
| 3463b780df | |||
| 31dead6d80 | |||
| cff78c3ab4 | |||
| 41383131b8 | |||
| 615f6608f1 | |||
| 8d019de97c | |||
| b5725c1eec | |||
| 381b275bc9 | |||
| f5b50f822b | |||
| a0c71a6d4c | |||
| 0abe1fb122 | |||
| a90cc48c7a | |||
| b0c74e2289 | |||
| 745ccf5066 | |||
| d1971558b5 | |||
| 8ba04c2476 | |||
| ca6d4ca4d1 | |||
| 585ca691a3 | |||
| 5298448e88 | |||
| 9ebff45853 | |||
| 8fd12ef14f | |||
| 57af9b98cf | |||
| 3b278277e0 | |||
| 49c6be334c | |||
| 1eb4a9f7e3 | |||
| 6515bd43ac | |||
| a8d450fcfe | |||
| 476fbd0950 | |||
| 43741b550d | |||
| 765c921e1f | |||
| 5ceabc6e6a | |||
| 1b6c0cbfb6 | |||
| 60fdd95b95 | |||
| 15e7672672 | |||
| 4fe6e46a0a | |||
| 9bfb7857ec | |||
| 75a27559a3 | |||
| dfba6a17f6 | |||
| 859f7eaa70 | |||
| b72bb7b289 | |||
| 9619055cfd | |||
| 48daf7ae72 | |||
| b18bb05b91 | |||
| 96db5642a1 | |||
| 693d32cdd4 | |||
| b978d9f0be | |||
| 49e6c2b676 | |||
| 39012290b8 | |||
| 89e771ea96 | |||
| 51de95ddee | |||
| e8e497eb83 | |||
| e142a27ab8 | |||
| 3c641a7ef5 | |||
| c6931a519f | |||
| 41ea90cddf | |||
| 4f7af188fe | |||
| 24e9b492fe | |||
| bc3ffa6b44 | |||
| 8ecc9b9e11 | |||
| 165923ebaf | |||
| 19d9875186 | |||
| dfb10448e2 | |||
| c5cd0c96f7 | |||
| 6fc37993fe | |||
| 23d08c0945 | |||
| 3c12ec8053 | |||
| 0b1625a798 | |||
| a6982fe7f5 | |||
| 0949a2e639 | |||
| 85639a20fb | |||
| c67458d189 | |||
| 5b1467af75 | |||
| 168de6fbc5 | |||
| 14735b470a | |||
| 22c8ffa2ba | |||
| da2aebe3e6 | |||
| 5bc125d1d5 | |||
| 5be0c6850e | |||
| f0cb627a8e | |||
| 5225697d9c | |||
| 903ad4d704 | |||
| dcd79f2adb | |||
| 701304c164 | |||
| 03e138c349 | |||
| 64716b9622 | |||
| b4b75ef682 | |||
| fc0c98f5c0 | |||
| c72a689f7f | |||
| d95e6c61b5 | |||
| 1b7e4070f5 | |||
| ceb18eeceb | |||
| 37295383ff | |||
| 98b7334209 | |||
| a1bdea305b | |||
| be42215003 | |||
| 8ce49ebea0 | |||
| 6cf850dd00 | |||
| e9e48006dd | |||
| c4baefff69 | |||
| 59ce7a9e19 | |||
| a23dcec3d2 | |||
| 9169e8c36e | |||
| 88ae099102 | |||
| 30038b82a4 | |||
| 1eeeb41f3f | |||
| 201bdd0eff | |||
| c212714cba | |||
| 8638d7b059 | |||
| 1ecd40d002 | |||
| b4099e568a | |||
| ea3b4a7315 | |||
| 1de030e2d0 | |||
| ef4bcdb44f | |||
| 2bc72cde05 | |||
| 8cd20303ca | |||
| 11951a614c | |||
| 9dfa357770 | |||
| 0a24e781b2 | |||
| 821f11176f | |||
| 15d2136f5f | |||
| 5f5c8da61f | |||
| 7a33e738fa | |||
| a09263f9d0 | |||
| c2569c5de4 | |||
| e674a7e2f3 | |||
| b8b5272577 | |||
| 7005789427 | |||
| dd52642d13 | |||
| 2aae91c3ed | |||
| 0d3419ecc4 | |||
| b3262c28d6 | |||
| 4a20d8802e | |||
| f21ebfb2ee | |||
| 69711ec322 | |||
| 8993abb9f1 | |||
| 6c0649ed9b | |||
| 7991e832a3 | |||
| 8548a9c621 | |||
| 78b405fd52 | |||
| a0f5c0445e | |||
| 299a037564 | |||
| 8e9fa7a807 | |||
| 23c7599ab3 | |||
| c10d7cc5f8 | |||
| dba7bad836 | |||
| bca6ca0237 | |||
| faaf459388 | |||
| a452b5ee7e | |||
| 9104cceedc | |||
| 100893dd33 | |||
| 56630b88a7 | |||
| 3f77ad8865 | |||
| 4453370768 | |||
| a38f25f78b | |||
| 50e7887498 | |||
| a86731afa9 | |||
| 2fb2d4e199 | |||
| 35d6717d6a | |||
| c872a54675 | |||
| b089a2b7ce | |||
| 216c85afe0 | |||
| b75a131805 | |||
| aaf5b34366 | |||
| 05000b1872 | |||
| f112f9b830 | |||
| 0184570176 | |||
| 5e25040a97 | |||
| bb191c1939 | |||
| 4a5f1df129 | |||
| 081832380c | |||
| b11669a2eb | |||
| aebbbd335e | |||
| 3366704c8f | |||
| a71120ca8f | |||
| 68b3f3b3d6 | |||
| 3ad9b0d9fa | |||
| e047558bee | |||
| 4b69204679 | |||
| 3026076ab5 | |||
| 762bfa7979 | |||
| 57831bb5c1 | |||
| 2e4c9236d6 | |||
| 3933bfdc57 | |||
| fe7f04ebdf | |||
| 2c0574594d | |||
| 389efdcf14 | |||
| 1e6d7c8a40 | |||
| d5f8446158 | |||
| 383b2a43df | |||
| 95311ab2d9 | |||
| ca4e18c81f | |||
| 1eeff6c349 | |||
| 9e05d7ee03 | |||
| 55fac5dd74 | |||
| d6615891c2 | |||
| af9d44f91b | |||
| 156123520b | |||
| 33ea0aa4e7 | |||
| 9bbea8a2a1 | |||
| 882597d17e | |||
| 64ead8ea1c | |||
| ab35c2d9ab | |||
| affce710e2 | |||
| a5e9b2e93e | |||
| 22a832f958 | |||
| e954d364f5 | |||
| 0b4e32180b | |||
| b3f38c4886 | |||
| 6ba88784a2 | |||
| e64870df9c | |||
| de602e3676 | |||
| 119fd9e1ad | |||
| 24efca8f4f | |||
| 9d02bf0868 | |||
| 45fe471b44 | |||
| a8bd148683 | |||
| ea89d6ec12 | |||
| 6ea8f2a2ae | |||
| 15282dde17 | |||
| bdab318cc6 | |||
| ea588a104c | |||
| 2b9faa8c7f | |||
| 562ab96b2f | |||
| a1cc7f3fbd | |||
| a8109a541d | |||
| 794c21484d | |||
| 7390538db0 | |||
| 559425cafa | |||
| 8fcc5cb349 | |||
| 3121f01f59 | |||
| ffcc12de5f | |||
| 6c44c4795e | |||
| 27e2212ac0 | |||
| 2ed441fde7 | |||
| 66812106e8 | |||
| 24c5a45431 | |||
| 1f0bc8cff9 | |||
| ccfc60e550 | |||
| 57393e7956 | |||
| 4975e76935 | |||
| e3e31ce9d7 | |||
| 56b8ad786b | |||
| 6b55a997a9 | |||
| b812cb3bcd | |||
| 13fd856db9 | |||
| 1548f141e0 | |||
| f05eb566e6 | |||
| 43290adc85 | |||
| 5f64bb35c9 | |||
| f41e5c9679 | |||
| 9c86a7d379 | |||
| 05c0efacab | |||
| 0c99745853 |
@@ -0,0 +1 @@
|
|||||||
|
/doc/tags
|
||||||
+150
@@ -0,0 +1,150 @@
|
|||||||
|
fugitive.vim
|
||||||
|
============
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|
View any blob, tree, commit, or tag in the repository with `:Gedit` (and
|
||||||
|
`:Gsplit`, `:Gvsplit`, `:Gtabedit`, ...). Edit a file in the index and
|
||||||
|
write to it to stage the changes. Use `:Gdiff` to bring up the staged
|
||||||
|
version of the file side by side with the working tree version and use
|
||||||
|
Vim's diff handling capabilities to stage a subset of the file's
|
||||||
|
changes.
|
||||||
|
|
||||||
|
Bring up the output of `git status` with `:Gstatus`. Press `-` to
|
||||||
|
`add`/`reset` a file's changes, or `p` to `add`/`reset` `--patch` that
|
||||||
|
mofo. And guess what `:Gcommit` does!
|
||||||
|
|
||||||
|
`:Gblame` brings up an interactive vertical split with `git blame`
|
||||||
|
output. Press enter on a line to reblame the file as it stood in that
|
||||||
|
commit, or `o` to open that commit in a split. When you're done, use
|
||||||
|
`: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
|
||||||
|
buffer. `:Gremove` does a `git rm` on a file and simultaneously deletes
|
||||||
|
the buffer.
|
||||||
|
|
||||||
|
Use `:Ggrep` to search the work tree (or any arbitrary commit) with
|
||||||
|
`git grep`, skipping over that which is not tracked in the repository.
|
||||||
|
`:Glog` loads all previous revisions of a file into the quickfix list so
|
||||||
|
you can iterate over them and watch the file evolve!
|
||||||
|
|
||||||
|
`:Gread` is a variant of `git checkout -- filename` that operates on the
|
||||||
|
buffer rather than the filename. 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.
|
||||||
|
|
||||||
|
Use `:Gbrowse` to open the current file on GitHub, with optional line
|
||||||
|
range (try it in visual mode!). If your current repository isn't on
|
||||||
|
GitHub, `git instaweb` will be spun up instead.
|
||||||
|
|
||||||
|
Add `%{fugitive#statusline()}` to `'statusline'` to get an indicator
|
||||||
|
with the current branch in (surprise!) your statusline.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
Screencasts
|
||||||
|
-----------
|
||||||
|
|
||||||
|
* [A complement to command line git](http://vimcasts.org/e/31)
|
||||||
|
* [Working with the git index](http://vimcasts.org/e/32)
|
||||||
|
* [Resolving merge conflicts with vimdiff](http://vimcasts.org/e/33)
|
||||||
|
* [Browsing the git object database](http://vimcasts.org/e/34)
|
||||||
|
* [Exploring the history of a git repository](http://vimcasts.org/e/35)
|
||||||
|
|
||||||
|
Installation
|
||||||
|
------------
|
||||||
|
|
||||||
|
If you don't have a preferred installation method, I recommend
|
||||||
|
installing [pathogen.vim](https://github.com/tpope/vim-pathogen), and
|
||||||
|
then simply copy and paste:
|
||||||
|
|
||||||
|
cd ~/.vim/bundle
|
||||||
|
git clone git://github.com/tpope/vim-fugitive.git
|
||||||
|
|
||||||
|
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
|
||||||
|
[vim-git](https://github.com/tpope/vim-git) for syntax highlighting and
|
||||||
|
other Git niceties.
|
||||||
|
|
||||||
|
FAQ
|
||||||
|
---
|
||||||
|
|
||||||
|
> I installed the plugin and started Vim. Why don't any of the commands
|
||||||
|
> exist?
|
||||||
|
|
||||||
|
Fugitive cares about the current file, not the current working
|
||||||
|
directory. Edit a file from the repository.
|
||||||
|
|
||||||
|
> I opened a new tab. Why don't any of the commands exist?
|
||||||
|
|
||||||
|
Fugitive cares about the current file, not the current working
|
||||||
|
directory. Edit a file from the repository.
|
||||||
|
|
||||||
|
> Why is `:Gbrowse` not using the right browser?
|
||||||
|
|
||||||
|
`:Gbrowse` delegates to `git web--browse`, which is less than perfect
|
||||||
|
when it comes to finding the right browser. You can tell it the correct
|
||||||
|
browser to use with `git config --global web.browser ...`. On OS X, for
|
||||||
|
example, you might want to set this to `open`. See `git web--browse --help`
|
||||||
|
for details.
|
||||||
|
|
||||||
|
> Here's a patch that automatically opens the quickfix window after
|
||||||
|
> `:Ggrep`.
|
||||||
|
|
||||||
|
This is a great example of why I recommend asking before patching.
|
||||||
|
There are valid arguments to be made both for and against automatically
|
||||||
|
opening the quickfix window. Whenever I have to make an arbitrary
|
||||||
|
decision like this, I ask what Vim would do. And Vim does not open a
|
||||||
|
quickfix window after `:grep`.
|
||||||
|
|
||||||
|
Luckily, it's easy to implement the desired behavior without changing
|
||||||
|
fugitive.vim. The following autocommand will cause the quickfix window
|
||||||
|
to open after any grep invocation:
|
||||||
|
|
||||||
|
autocmd QuickFixCmdPost *grep* cwindow
|
||||||
|
|
||||||
|
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
|
||||||
|
[GitHub](https://github.com/tpope/vim-fugitive) and vote for it on
|
||||||
|
[vim.org](http://www.vim.org/scripts/script.php?script_id=2975). And if
|
||||||
|
you're feeling especially charitable, follow [tpope](http://tpo.pe/) on
|
||||||
|
[Twitter](http://twitter.com/tpope) and
|
||||||
|
[GitHub](https://github.com/tpope).
|
||||||
|
|
||||||
|
License
|
||||||
|
-------
|
||||||
|
|
||||||
|
Copyright (c) Tim Pope. Distributed under the same terms as Vim itself.
|
||||||
|
See `:help license`.
|
||||||
+133
-37
@@ -1,38 +1,14 @@
|
|||||||
*fugitive.txt* A Git wrapper so awesome, it should be illegal
|
*fugitive.txt* A Git wrapper so awesome, it should be illegal
|
||||||
|
|
||||||
Author: Tim Pope <vimNOSPAM@tpope.info> *fugitive-author*
|
Author: Tim Pope <http://tpo.pe/>
|
||||||
License: Same terms as Vim itself (see |license|)
|
License: Same terms as Vim itself (see |license|)
|
||||||
|
|
||||||
This plugin is only available if 'compatible' is not set.
|
This plugin is only available if 'compatible' is not set.
|
||||||
|
|
||||||
INTRODUCTION *fugitive*
|
INTRODUCTION *fugitive*
|
||||||
|
|
||||||
Install in ~/.vim, or in ~\vimfiles if you're on Windows and feeling lucky.
|
Whenever you edit a file from a Git repository, a set of commands is defined
|
||||||
Vim 7.2 is recommended as it ships with syntax highlighting for many Git file
|
that serve as a gateway to Git.
|
||||||
types.
|
|
||||||
|
|
||||||
If you're in a hurry to get started, here are some things to try:
|
|
||||||
|
|
||||||
In any file in your repository, run |:Gedit| HEAD. Press <CR> to jump to the
|
|
||||||
current branch. Press <CR> again to jump to the top most commit. Keep using
|
|
||||||
<CR> to explore parent commits, trees, and blobs. Use C in a tree or blob to
|
|
||||||
get back to the commit.
|
|
||||||
|
|
||||||
Edit a file in the work tree and make some changes. Use |:Gdiff| to open up
|
|
||||||
the indexed version. Use |do| and |dp| on various hunks to bring the files in
|
|
||||||
sync, or use |:Gread| to pull in all changes. Write the indexed version to
|
|
||||||
stage the file.
|
|
||||||
|
|
||||||
Run |:Gstatus| to check your repository's status. Use "-" to stage and reset
|
|
||||||
files and "p" to add/reset --patch them. Invoke |:Gcommit| to commit your
|
|
||||||
changes.
|
|
||||||
|
|
||||||
Run |:Gblame| in a work tree file to see a blame in a vertical split. Press
|
|
||||||
<CR> on any line to reopen and reblame that file as it stood in that commit.
|
|
||||||
Press o or O on any line to inspect that commit in a split or a tab.
|
|
||||||
|
|
||||||
Run |:Ggrep| to search the work tree or history. Run |:Gmove| to rename a
|
|
||||||
file. Run |:Gremove| to delete a file.
|
|
||||||
|
|
||||||
COMMANDS *fugitive-commands*
|
COMMANDS *fugitive-commands*
|
||||||
|
|
||||||
@@ -43,6 +19,10 @@ that are part of Git repositories).
|
|||||||
:Git [args] Run an arbitrary git command. Similar to :!git [args]
|
:Git [args] Run an arbitrary git command. Similar to :!git [args]
|
||||||
but chdir to the repository tree first.
|
but chdir to the repository tree first.
|
||||||
|
|
||||||
|
*fugitive-:Git!*
|
||||||
|
:Git! [args] Like |:Git|, but capture the output into a temp file,
|
||||||
|
and edit that temp file.
|
||||||
|
|
||||||
*fugitive-:Gcd*
|
*fugitive-:Gcd*
|
||||||
:Gcd [directory] |:cd| relative to the repository.
|
:Gcd [directory] |:cd| relative to the repository.
|
||||||
|
|
||||||
@@ -51,9 +31,31 @@ that are part of Git repositories).
|
|||||||
|
|
||||||
*fugitive-:Gstatus*
|
*fugitive-:Gstatus*
|
||||||
:Gstatus Bring up the output of git-status in the preview
|
:Gstatus Bring up the output of git-status in the preview
|
||||||
window. Press - to stage or unstage the file on the
|
window. The following maps, which work on the cursor
|
||||||
cursor line. Press p to do so on a per hunk basis
|
line file where sensible, are provided:
|
||||||
(--patch). Press C to invoke |:Gcommit|.
|
|
||||||
|
<C-N> next file
|
||||||
|
<C-P> previous file
|
||||||
|
<CR> |:Gedit|
|
||||||
|
- |:Git| add
|
||||||
|
- |:Git| reset (staged files)
|
||||||
|
cA |:Gcommit| --amend --reuse-message=HEAD
|
||||||
|
ca |:Gcommit| --amend
|
||||||
|
cc |:Gcommit|
|
||||||
|
cva |:Gcommit| --amend --verbose
|
||||||
|
cvc |:Gcommit| --verbose
|
||||||
|
D |:Gdiff|
|
||||||
|
ds |:Gsdiff|
|
||||||
|
dp |:Git!| diff (p for patch; use :Gw to apply)
|
||||||
|
dp |:Git| add --intent-to-add (untracked files)
|
||||||
|
dv |:Gvdiff|
|
||||||
|
O |:Gtabedit|
|
||||||
|
o |:Gsplit|
|
||||||
|
p |:Git| add --patch
|
||||||
|
p |:Git| reset --patch (staged files)
|
||||||
|
q close status
|
||||||
|
R reload status
|
||||||
|
S |:Gvsplit|
|
||||||
|
|
||||||
*fugitive-:Gcommit*
|
*fugitive-:Gcommit*
|
||||||
:Gcommit [args] A wrapper around git-commit. If there is nothing
|
:Gcommit [args] A wrapper around git-commit. If there is nothing
|
||||||
@@ -70,12 +72,20 @@ that are part of Git repositories).
|
|||||||
*fugitive-:Ggrep*
|
*fugitive-:Ggrep*
|
||||||
:Ggrep [args] |:grep| with git-grep as 'grepprg'.
|
:Ggrep [args] |:grep| with git-grep as 'grepprg'.
|
||||||
|
|
||||||
|
*fugitive-:Glgrep*
|
||||||
|
:Glgrep [args] |:lgrep| with git-grep as 'grepprg'.
|
||||||
|
|
||||||
*fugitive-:Glog*
|
*fugitive-:Glog*
|
||||||
:Glog [args] Load all previous revisions of the current file into
|
:Glog [args] Load all previous revisions of the current file into
|
||||||
the quickfix list. Additional git-log arguments can
|
the quickfix list. Additional git-log arguments can
|
||||||
be given (for example, --reverse). If "--" appears as
|
be given (for example, --reverse). If "--" appears as
|
||||||
an argument, no file specific filtering is done, and
|
an argument, no file specific filtering is done, and
|
||||||
commits are loaded into the quickfix list.
|
previous commits rather than previous file revisions
|
||||||
|
are loaded.
|
||||||
|
|
||||||
|
*fugitive-:Gllog*
|
||||||
|
:Gllog [args] Like |:Glog|, but use the location list instead of the
|
||||||
|
quickfix list.
|
||||||
|
|
||||||
*fugitive-:Gedit* *fugitive-:Ge*
|
*fugitive-:Gedit* *fugitive-:Ge*
|
||||||
:Gedit [revision] |:edit| a |fugitive-revision|.
|
:Gedit [revision] |:edit| a |fugitive-revision|.
|
||||||
@@ -87,10 +97,15 @@ that are part of Git repositories).
|
|||||||
:Gvsplit [revision] |:vsplit| a |fugitive-revision|.
|
:Gvsplit [revision] |:vsplit| a |fugitive-revision|.
|
||||||
|
|
||||||
*fugitive-:Gtabedit*
|
*fugitive-:Gtabedit*
|
||||||
:Gtabedit [revision] |:tabedit| a |fugitive-revision|
|
:Gtabedit [revision] |:tabedit| a |fugitive-revision|.
|
||||||
|
|
||||||
*fugitive-:Gpedit*
|
*fugitive-:Gpedit*
|
||||||
:Gpedit [revision] |:pedit| a |fugitive-revision|
|
:Gpedit [revision] |:pedit| a |fugitive-revision|.
|
||||||
|
|
||||||
|
:Gsplit! [args] *fugitive-:Gsplit!* *fugitive-:Gvsplit!*
|
||||||
|
:Gvsplit! [args] *fugitive-:Gtabedit!* *fugitive-:Gpedit!*
|
||||||
|
:Gtabedit! [args] Like |:Git!|, but open the resulting temp file in a
|
||||||
|
:Gpedit! [args] split, tab, or preview window.
|
||||||
|
|
||||||
*fugitive-:Gread*
|
*fugitive-:Gread*
|
||||||
:Gread [revision] Empty the buffer and |:read| a |fugitive-revision|.
|
:Gread [revision] Empty the buffer and |:read| a |fugitive-revision|.
|
||||||
@@ -102,7 +117,10 @@ that are part of Git repositories).
|
|||||||
|:read| in a |fugitive-revision| after {range}.
|
|:read| in a |fugitive-revision| after {range}.
|
||||||
|
|
||||||
*fugitive-:Gread!*
|
*fugitive-:Gread!*
|
||||||
:Gread! [revision] Deprecated synonym for |:Gread|.
|
:Gread! [args] Empty the buffer and |:read| the output of a Git
|
||||||
|
command. For example, :Gread! show HEAD:%.
|
||||||
|
|
||||||
|
:{range}Gread! [args] |:read| the output of a Git command after {range}.
|
||||||
|
|
||||||
*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.
|
||||||
@@ -117,6 +135,13 @@ that are part of Git repositories).
|
|||||||
:0:foo.txt or even :0 to write to just that stage in
|
:0:foo.txt or even :0 to write to just that stage in
|
||||||
the index.
|
the index.
|
||||||
|
|
||||||
|
*fugitive-:Gwq*
|
||||||
|
:Gwq [path] Like |:Gwrite| followed by |:quit| if the write
|
||||||
|
succeeded.
|
||||||
|
|
||||||
|
:Gwq! [path] Like |:Gwrite|! followed by |:quit|! if the write
|
||||||
|
succeeded.
|
||||||
|
|
||||||
*fugitive-:Gdiff*
|
*fugitive-:Gdiff*
|
||||||
:Gdiff [revision] Perform a |vimdiff| against the current file in the
|
:Gdiff [revision] Perform a |vimdiff| against the current file in the
|
||||||
given revision. With no argument, the version in the
|
given revision. With no argument, the version in the
|
||||||
@@ -126,6 +151,12 @@ that are part of Git repositories).
|
|||||||
to the right. Use |do| and |dp| and write to the
|
to the right. Use |do| and |dp| and write to the
|
||||||
index file to simulate "git add --patch".
|
index file to simulate "git add --patch".
|
||||||
|
|
||||||
|
*fugitive-:Gsdiff*
|
||||||
|
:Gsdiff [revision] Like |:Gdiff|, but split horizontally.
|
||||||
|
|
||||||
|
*fugitive-:Gvdiff*
|
||||||
|
: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
|
||||||
afterward. The destination is relative to the current
|
afterward. The destination is relative to the current
|
||||||
@@ -139,14 +170,66 @@ that are part of Git repositories).
|
|||||||
buffer.
|
buffer.
|
||||||
|
|
||||||
*fugitive-:Gblame*
|
*fugitive-:Gblame*
|
||||||
:Gblame 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. Press enter on a line to
|
scroll bound vertical split. Press enter on a line to
|
||||||
reblame the file as it was in that commit.
|
reblame the file as it was in that commit. You can
|
||||||
|
give any of ltfnsewMC as flags and they will be passed
|
||||||
|
along to git-blame. The following maps, which work on
|
||||||
|
the cursor line commit where sensible, are provided:
|
||||||
|
|
||||||
:[range]Gblame Run git-blame on the given range.
|
A resize to end of author column
|
||||||
|
C resize to end of commit column
|
||||||
|
D resize to end of date/time column
|
||||||
|
q close blame and return to blamed window
|
||||||
|
gq q, then |:Gedit| to return to work tree version
|
||||||
|
i q, then open commit
|
||||||
|
o open commit in horizontal split
|
||||||
|
O open commit in new tab
|
||||||
|
- reblame at commit
|
||||||
|
~ reblame at [count]th first grandparent
|
||||||
|
P reblame at [count]th parent (like HEAD^[count])
|
||||||
|
|
||||||
|
:[range]Gblame [flags] Run git-blame on the given range.
|
||||||
|
|
||||||
|
*fugitive-:Gbrowse*
|
||||||
|
:[range]Gbrowse If the remote for the current branch is on GitHub,
|
||||||
|
open the current file, blob, tree, commit, or tag
|
||||||
|
(with git-web--browse) on GitHub. Otherwise, open the
|
||||||
|
current file, blob, tree, commit, or tag in
|
||||||
|
git-instaweb (if you have issues, verify you can run
|
||||||
|
"git instaweb" from a terminal). If a range is given,
|
||||||
|
it is appropriately appended to the URL as an anchor.
|
||||||
|
|
||||||
|
To use with GitHub FI, point g:fugitive_github_domains
|
||||||
|
at a list of domains:
|
||||||
|
>
|
||||||
|
let g:fugitive_github_domains = ['git.example.com']
|
||||||
|
~
|
||||||
|
:[range]Gbrowse! Like :Gbrowse, but put the URL on the clipboard rather
|
||||||
|
than opening it.
|
||||||
|
|
||||||
|
:[range]Gbrowse {revision}
|
||||||
|
Like :Gbrowse, but for a given |fugitive-revision|. A
|
||||||
|
useful value here is -, which ties the URL to the
|
||||||
|
latest commit rather than a volatile branch.
|
||||||
|
|
||||||
|
:[range]Gbrowse [...]@{remote}
|
||||||
|
Force using the given remote rather than the remote
|
||||||
|
for the current branch. The remote is used to
|
||||||
|
determine which GitHub repository to link to.
|
||||||
|
|
||||||
MAPPINGS *fugitive-mappings*
|
MAPPINGS *fugitive-mappings*
|
||||||
|
|
||||||
|
These maps are available everywhere.
|
||||||
|
|
||||||
|
*fugitive-c_CTRL-R_CTRL-G*
|
||||||
|
<C-R><C-G> On the command line, recall the path to the current
|
||||||
|
object (that is, a representation of the object
|
||||||
|
recognized by |:Gedit|).
|
||||||
|
|
||||||
|
*fugitive-y_CTRL-G*
|
||||||
|
["x]y<C-G> Yank the commit SHA and path to the current object.
|
||||||
|
|
||||||
These maps are available in Git objects.
|
These maps are available in Git objects.
|
||||||
|
|
||||||
*fugitive-<CR>*
|
*fugitive-<CR>*
|
||||||
@@ -155,9 +238,16 @@ These maps are available in Git objects.
|
|||||||
*fugitive-o*
|
*fugitive-o*
|
||||||
o Jump to the revision under the cursor in a new split.
|
o Jump to the revision under the cursor in a new split.
|
||||||
|
|
||||||
|
*fugitive-S*
|
||||||
|
S Jump to the revision under the cursor in a new
|
||||||
|
vertical split.
|
||||||
|
|
||||||
*fugitive-O*
|
*fugitive-O*
|
||||||
O Jump to the revision under the cursor in a new tab.
|
O Jump to the revision under the cursor in a new tab.
|
||||||
|
|
||||||
|
*fugitive--*
|
||||||
|
- Go to the tree containing the current tree or blob.
|
||||||
|
|
||||||
*fugitive-~*
|
*fugitive-~*
|
||||||
~ Go to the current file in the [count]th first
|
~ Go to the current file in the [count]th first
|
||||||
ancestor.
|
ancestor.
|
||||||
@@ -208,6 +298,12 @@ a statusline, this one matches the default when 'ruler' is set:
|
|||||||
>
|
>
|
||||||
set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P
|
set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P
|
||||||
<
|
<
|
||||||
|
*fugitive#head(...)*
|
||||||
|
Use fugitive#head() to return the name of the current branch. If the current
|
||||||
|
HEAD is detached, fugitive#head() will return the empty string, unless the
|
||||||
|
optional argument is given, in which case the hash of the current commit will
|
||||||
|
be truncated to the given number of characters.
|
||||||
|
|
||||||
ABOUT *fugitive-about*
|
ABOUT *fugitive-about*
|
||||||
|
|
||||||
Grab the latest version or report a bug on GitHub:
|
Grab the latest version or report a bug on GitHub:
|
||||||
|
|||||||
+1159
-280
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user