mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-10 12:33:46 -05:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea7b1ab602 |
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -1,2 +0,0 @@
|
|||||||
.git* export-ignore
|
|
||||||
*.markdown export-ignore
|
|
||||||
@@ -1,24 +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](https://commit.style), I'm not going to accept it. Period.
|
|
||||||
|
|
||||||
If your contribution involves adding a configuration option, you are going to
|
|
||||||
need a very compelling justification for it. Options add a maintenance
|
|
||||||
burden, support burden, and documentation bloat, and oftentimes can be
|
|
||||||
achieved much more simply with a custom map or autocommand. If your option
|
|
||||||
controls an underlying Git command, ask yourself why Git itself does not offer
|
|
||||||
such configuration.
|
|
||||||
|
|
||||||
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.
|
|
||||||
105
README.markdown
105
README.markdown
@@ -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,16 +12,16 @@ 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. `:Gdelete` does a `git rm` on a file and simultaneously deletes
|
buffer. `:Gremove` does a `git rm` on a file and simultaneously deletes
|
||||||
the buffer.
|
the buffer.
|
||||||
|
|
||||||
Use `:Ggrep` to search the work tree (or any arbitrary commit) with
|
Use `:Ggrep` to search the work tree (or any arbitrary commit) with
|
||||||
@@ -35,77 +36,35 @@ and you never get any warnings about the file changing outside Vim.
|
|||||||
making it like `git add` when called from a work tree file and like
|
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.
|
`git checkout` when called from the index or a blob in history.
|
||||||
|
|
||||||
Use `:Gbrowse` to open the current file on the web front-end of your favorite
|
Use `:Gbrowse` to open the current file on GitHub, with optional line
|
||||||
hosting provider, with optional line range (try it in visual mode!). Built-in
|
range (try it in visual mode!). If your current repository isn't on
|
||||||
support is provided for `git instaweb`, and plugins are available for popular
|
GitHub, `git instaweb` will be spun up instead.
|
||||||
providers such as [GitHub][rhubarb.vim], [GitLab][fugitive-gitlab.vim], and
|
|
||||||
[Bitbucket][fubitive.vim].
|
|
||||||
|
|
||||||
[rhubarb.vim]: https://github.com/tpope/vim-rhubarb
|
|
||||||
[fugitive-gitlab.vim]: https://github.com/shumphrey/fugitive-gitlab.vim
|
|
||||||
[fubitive.vim]: https://github.com/tommcdo/vim-fubitive
|
|
||||||
|
|
||||||
Add `%{fugitive#statusline()}` to `'statusline'` to get an indicator
|
Add `%{fugitive#statusline()}` to `'statusline'` to get an indicator
|
||||||
with the current branch in (surprise!) your statusline.
|
with the current branch in (surprise!) your statusline.
|
||||||
|
|
||||||
Last but not least, there's `:Git` for running any arbitrary command,
|
Oh, and of course 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, one option is to install
|
|
||||||
[pathogen.vim](https://github.com/tpope/vim-pathogen), and then copy
|
|
||||||
and paste:
|
|
||||||
|
|
||||||
cd ~/.vim/bundle
|
|
||||||
git clone https://github.com/tpope/vim-fugitive.git
|
|
||||||
vim -u NONE -c "helptags vim-fugitive/doc" -c q
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
> 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. To avoid the blank window problem, favor
|
|
||||||
commands like `:split` and `:tabedit` over commands like `:new` and `:tabnew`.
|
|
||||||
|
|
||||||
> 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
|
|
||||||
|
|
||||||
## 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](http://github.com/tpope/vim-fugitive) and vote for it on
|
||||||
[vim.org](http://www.vim.org/scripts/script.php?script_id=2975). And if
|
[vim.org](http://www.vim.org/scripts/script.php?script_id=2975).
|
||||||
you're feeling especially charitable, follow [tpope](http://tpo.pe/) on
|
|
||||||
[Twitter](http://twitter.com/tpope) and
|
|
||||||
[GitHub](https://github.com/tpope).
|
|
||||||
|
|
||||||
## License
|
FAQ
|
||||||
|
---
|
||||||
|
|
||||||
Copyright (c) Tim Pope. Distributed under the same terms as Vim itself.
|
> I installed the plugin and started Vim. Why don't any of the commands
|
||||||
See `:help license`.
|
> 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.
|
||||||
|
|
||||||
|
> I changed the current working directory. Why do all the commands use
|
||||||
|
> the old directory?
|
||||||
|
|
||||||
|
Fugitive cares about the current file, not the current working
|
||||||
|
directory. Edit a file from the repository.
|
||||||
|
|||||||
255
doc/fugitive.txt
255
doc/fugitive.txt
@@ -1,14 +1,38 @@
|
|||||||
*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 <http://tpo.pe/>
|
Author: Tim Pope <vimNOSPAM@tpope.org> *fugitive-author*
|
||||||
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*
|
||||||
|
|
||||||
Whenever you edit a file from a Git repository, a set of commands is defined
|
Install in ~/.vim, or in ~\vimfiles if you're on Windows and feeling lucky.
|
||||||
that serve as a gateway to Git.
|
Vim 7.2 is recommended as it ships with syntax highlighting for many Git file
|
||||||
|
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*
|
||||||
|
|
||||||
@@ -19,10 +43,6 @@ 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.
|
||||||
|
|
||||||
@@ -31,93 +51,37 @@ 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. The following maps, which work on the cursor
|
window. In addition to standard motions, you can
|
||||||
line file where sensible, are provided:
|
use <C-N> and <C-P> to jump from filename to
|
||||||
|
filename. Press C to invoke |:Gcommit|. Press D to
|
||||||
g? show this help
|
|:Gdiff| the file on the cursor line, or ds to
|
||||||
<C-N> next file
|
|:Gsdiff|. Press - to stage or unstage the file on
|
||||||
<C-P> previous file
|
the cursor line. Press p to do so on a per hunk basis
|
||||||
<CR> |:Gedit|
|
(--patch). All of D, -, and p have a different,
|
||||||
- |:Git| add
|
sensible (and hopefully intuitive) behavior when
|
||||||
- |:Git| reset (staged files)
|
invoked on a heading rather than a file name.
|
||||||
a Show alternative format
|
|
||||||
ca |:Gcommit| --amend
|
|
||||||
cc |:Gcommit|
|
|
||||||
ce |:Gcommit| --amend --no-edit
|
|
||||||
cw |:Gcommit| --amend --only
|
|
||||||
cva |:Gcommit| --verbose --amend
|
|
||||||
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|
|
|
||||||
U |:Git| checkout
|
|
||||||
U |:Git| checkout HEAD (staged files)
|
|
||||||
U |:Git| clean (untracked files)
|
|
||||||
U |:Git| rm (unmerged files)
|
|
||||||
|
|
||||||
*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
|
||||||
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'.
|
||||||
|
|
||||||
*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
|
||||||
previous commits rather than previous file revisions
|
commits are loaded into the quickfix list.
|
||||||
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*
|
|
||||||
: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|.
|
||||||
@@ -129,15 +93,10 @@ 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|.
|
||||||
@@ -148,13 +107,7 @@ that are part of Git repositories).
|
|||||||
:{range}Gread [revision]
|
:{range}Gread [revision]
|
||||||
|:read| in a |fugitive-revision| after {range}.
|
|:read| in a |fugitive-revision| after {range}.
|
||||||
|
|
||||||
*fugitive-:Gread!*
|
*fugitive-:Gwrite*
|
||||||
: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-:Gw* *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
|
||||||
@@ -180,107 +133,60 @@ 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". For the three-way diff, there is
|
|
||||||
also d2o and d3o pulling the hunk to the middle from
|
|
||||||
the left or the right window, respectively.
|
|
||||||
|
|
||||||
*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
|
||||||
afterward. The destination is relative to the current
|
afterward. The destination is relative to the current
|
||||||
directory except when started with a /, in which case
|
directory except when started with a /, in which case
|
||||||
it is relative to the work tree. (This is a holdover
|
it is relative to the work tree. Add a ! to pass -f.
|
||||||
from before |:Grename| and will be removed.) Add a !
|
|
||||||
to pass -f.
|
|
||||||
|
|
||||||
*fugitive-:Grename*
|
*fugitive-:Gremove*
|
||||||
:Grename {destination} Like |:Gmove| but operates relative to the parent
|
:Gremove Wrapper around git-rm that deletes the buffer
|
||||||
directory of the current file.
|
|
||||||
|
|
||||||
*fugitive-:Gdelete*
|
|
||||||
:Gdelete Wrapper around git-rm that deletes the buffer
|
|
||||||
afterward. When invoked in an index file, --cached is
|
afterward. When invoked in an index file, --cached is
|
||||||
passed. Add a ! to pass -f and forcefully discard the
|
passed. Add a ! to pass -f and forcefully discard the
|
||||||
buffer.
|
buffer.
|
||||||
|
|
||||||
*fugitive-:Gremove*
|
|
||||||
:Gremove Like :Gdelete, but keep the (now empty) buffer around.
|
|
||||||
|
|
||||||
*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 ltwfsMC as flags and they will be passed
|
||||||
cursor line commit where sensible, are provided:
|
along to git-blame.
|
||||||
|
|
||||||
g? show this help
|
|
||||||
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
|
|
||||||
<CR> 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.
|
:[range]Gblame [flags] Run git-blame on the given range.
|
||||||
|
|
||||||
*fugitive-:Gbrowse*
|
*fugitive-:Gbrowse*
|
||||||
:Gbrowse Open the current file, blob, tree, commit, or tag
|
:[range]Gbrowse If the remote for the current branch is on GitHub,
|
||||||
in your browser at the upstream hosting provider.
|
open the current file, blob, tree, commit, or tag
|
||||||
If a range is given, it is appropriately appended to
|
(with git-web--browse) on GitHub. Otherwise, open the
|
||||||
the URL as an anchor.
|
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.
|
||||||
|
|
||||||
Upstream providers can be added by installing an
|
:[range]Gbrowse! Like :Gbrowse, but put the URL on the clipboard rather
|
||||||
appropriate Vim plugin. For example, GitHub can be
|
than opening it.
|
||||||
supported by installing rhubarb.vim, available at
|
|
||||||
<https://github.com/tpope/vim-rhubarb>.
|
|
||||||
|
|
||||||
The hosting provider is determined by looking at the
|
:[range]Gbrowse {revision}
|
||||||
remote for the current or specified branch and falls
|
Like :Gbrowse, but for a given |fugitive-revision|. A
|
||||||
back to "origin". In the special case of a "."
|
|
||||||
remote, a local instance of git-instaweb will be
|
|
||||||
started and used.
|
|
||||||
|
|
||||||
:Gbrowse {revision} Like :Gbrowse, but for a given |fugitive-revision|. A
|
|
||||||
useful value here is -, which ties the URL to the
|
useful value here is -, which ties the URL to the
|
||||||
latest commit rather than a volatile branch.
|
latest commit rather than a volatile branch.
|
||||||
|
|
||||||
:Gbrowse [...]@{remote} Force using the given remote rather than the remote
|
:[range]Gbrowse [...]@{remote}
|
||||||
|
Force using the given remote rather than the remote
|
||||||
for the current branch. The remote is used to
|
for the current branch. The remote is used to
|
||||||
determine which GitHub repository to link to.
|
determine which GitHub repository to link to.
|
||||||
|
|
||||||
:{range}Gbrowse [args] Appends an anchor to the URL that emphasizes the
|
|
||||||
selected lines. You almost certainly want to give a
|
|
||||||
"-" argument in this case to force the URL to include
|
|
||||||
an exact revision.
|
|
||||||
|
|
||||||
:[range]Gbrowse! [args] Like :Gbrowse, but put the URL on the clipboard rather
|
|
||||||
than opening it.
|
|
||||||
|
|
||||||
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>*
|
||||||
@@ -289,16 +195,9 @@ 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.
|
||||||
@@ -309,10 +208,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.
|
||||||
@@ -353,12 +248,6 @@ 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:
|
||||||
|
|||||||
2366
plugin/fugitive.vim
2366
plugin/fugitive.vim
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user