730 Commits
v2.3 ... v3.1

Author SHA1 Message Date
Tim Pope
427ac52d7d fugitive.vim 3.1
* Commands are now global, not buffer local.
* Calling a command in an unnamed buffer uses the working directory.
* Preserve line number on :Gedit to return to work tree buffer.
* Better submodule support in :Gstatus.
* Support git-blame revision ignoring features.
* Show first parent diff in merge commit buffer.
* Remove deprecated support for .git/tags.
* Bug fixes.
2019-10-10 19:47:39 -04:00
Tim Pope
8c29bf1bb9 Tab complete > arguments 2019-10-10 19:45:25 -04:00
Tim Pope
ea818f1fab Include PowerShell in check for win32 shell
Closes https://github.com/tpope/vim-fugitive/issues/435
2019-10-09 11:33:53 -04:00
Marco Hinz
698065596c Fix incorrect script id (part 2)
This is a follow-up to 28abadc.

Without the \zs, everything up to the regexp for the script ID would be
used.

Now, s:function() is the same as the one used in scriptease.
2019-10-07 13:23:06 -04:00
Tim Pope
28abadcb84 Fix incorrect script id from nested function call
Closes https://github.com/tpope/vim-fugitive/pull/1370
2019-10-07 12:08:12 -04:00
Maksim Odnoletkov
a3ba0ca67f Fix status diffs broken by missing sub attribute
Fixes https://github.com/tpope/vim-fugitive/issues/1367
2019-10-05 21:25:32 -04:00
Maksim Odnoletkov
973d814e26 Rudimentary support for diff maps for submodules in status 2019-10-04 14:47:09 -04:00
Maksim Odnoletkov
a21ca7e86e Support X for submodules
Staged/[MD]:
Unstage and checkout superproject recorded version

Staged/A:
Noop. 'git rm -f' would be appropriate but it is destructive for
non-staged changes and hard to undo

Unstaged/A:
Noop. Hard to reproduce in practice, 'git status' doesn't handle it well
and hard to undo

Unstaged/[MD]:
Checkout superproject recorded version

Unstaged/[m?]:
Noop. Discarding submodules content changes is too complicated.
Workaround is to <CR> to submodule and discard from it's :Gstatus.
2019-10-04 14:47:09 -04:00
Maksim Odnoletkov
f779b90fbd Add --porcelain=v2 status parser
New submodule modifiers:

- 'M' if submodule commit is changed, otherwise
- '?' if there is modified or untracked content

Keep using v1 parser for git versions older than 2.11. This will display
'M' for any submodule changes.

Test with https://github.com/odnoletkov/git-status-test-suite

Fixes https://github.com/tpope/vim-fugitive/issues/1204
2019-10-04 14:47:09 -04:00
Maksim Odnoletkov
80aa8a9aea Fix reverse blame jump for the boundary edge case
When the line is reverse-blamed to an *immediate* child of the current
commit it is shown as `^commit` in the reverse blame output. In this
case we still need to open the child of this commit since it will be a
commit removing the line.

Closes https://github.com/tpope/vim-fugitive/issues/1359
2019-10-02 18:11:02 -04:00
Tim Pope
c9cf1b3cb2 Make remaining buffer commands global 2019-10-02 14:40:38 -04:00
Tim Pope
cfdfc1ba14 Clearer error message on attempt to delete directory
Recursive deletion is too dangerous to provide without a confirmation
prompt.

Closes https://github.com/tpope/vim-fugitive/issues/1364
2019-10-02 14:01:22 -04:00
Tim Pope
5eeb7625df Expand status file lookup into nested structure
References https://github.com/tpope/vim-fugitive/pull/1337
2019-10-01 16:19:36 -04:00
Tim Pope
4f0905e963 Preserve line number on :Gedit with no or > argument
Closes https://github.com/tpope/vim-fugitive/pull/1326
2019-10-01 15:43:12 -04:00
Tim Pope
f72ca2e6c1 Improve ++opt +cmd handling for :Gedit/:Gread 2019-09-30 20:43:16 -04:00
Tim Pope
621ffb087a Fix :'<,'>Gclog on some Vim versions
This was an attempt to get out in front of issues like
https://github.com/tpope/vim-scriptease/issues/43, but looks like it has
problems of its own.

Closes https://github.com/tpope/vim-fugitive/issues/1358
2019-09-30 19:07:04 -04:00
Tim Pope
24b463b5b3 Support REVERT_HEAD and CHERRY_PICK_HEAD 2019-09-30 17:53:11 -04:00
Tim Pope
eedfd2a570 Don't show tags warning when editing commit message 2019-09-28 11:14:30 -04:00
Tim Pope
ab26e9fdb3 Trigger User FugitiveChanged on events that change repository
Note that in the context of this event, Fugitive functions will use the
changed repository, which might not be the same as the current buffer's
repository.  Pass bufnr() as the optional dir argument to force the
current buffer.

Closes https://github.com/tpope/vim-fugitive/issues/458
2019-09-27 09:30:40 -04:00
Tim Pope
fee14c149c Don't reload status on non-Fugitive ShellCmdPost 2019-09-27 09:30:40 -04:00
Tim Pope
540d8024c2 Force status reload on commands likely to change it 2019-09-27 09:30:40 -04:00
Andrey Starodubtsev
9c91766118 Vim's redraw can change v:shell_error
If any other plugins besides `vim-fugitive` are present in user's
instance of Vim, they can call external programs to show some
properties. Redraw will force them to call this programs again and value
of last shell error can be changed.
2019-09-27 09:20:41 -04:00
Tim Pope
6eb5d8e4b2 Fix buffer local commands
Closes https://github.com/tpope/vim-fugitive/issues/1353
2019-09-26 16:20:19 -04:00
Jakub Kadlcik
0cf70ab9fc List pagure plugin 2019-09-26 14:05:58 -04:00
Tim Pope
80ef19665a Fix typo 2019-09-26 10:48:07 -04:00
Tim Pope
18893e8ca7 Use more conventional quickfix event type for :Ggrep
References https://github.com/tpope/vim-scriptease/pull/45
2019-09-26 10:46:53 -04:00
Tim Pope
1b292303c2 Encapsulate doautocmd <nomodeline> 2019-09-26 10:46:53 -04:00
Tim Pope
c1244ea7d0 Default to left, not right split for empty :Gdiffsplit filename
This only happens in weird circumstances such as when you call
:Gdiffsplit in a commit object.
2019-09-26 10:46:53 -04:00
Maksim Odnoletkov
eec184e8b0 Fix blame help maps 2019-09-26 03:56:51 -04:00
Tim Pope
417b3bb818 Fix off by 2 error staging multiple files 2019-09-22 21:30:05 -04:00
Tim Pope
edd054f76f Fix visual mode exclusion for staging on section header 2019-09-22 21:29:40 -04:00
Tim Pope
37088aaf65 Fix X on removed file
References https://github.com/tpope/vim-fugitive/issues/1343
2019-09-22 21:27:41 -04:00
Tim Pope
1d8c0a38b2 Show first parent diff for merge commits
Closes https://github.com/tpope/vim-fugitive/issues/1121
2019-09-18 21:54:22 -04:00
Tim Pope
f5a94cbc81 Reload status after Vim :terminal command
Closes https://github.com/tpope/vim-fugitive/issues/1323
2019-09-16 17:25:47 -04:00
Tim Pope
dc413818a6 Fire ShellCmdPost after :Gpush
References https://github.com/vim-airline/vim-airline/issues/1970
2019-09-16 16:32:23 -04:00
Maksim Odnoletkov
2cf584f97d Remove redundant jump when opening :Gstatus
Fixes https://github.com/tpope/vim-fugitive/issues/1333
2019-09-16 16:13:56 -04:00
Maksim Odnoletkov
26f6037de6 Reveal folds when using jump maps in commits 2019-09-11 18:13:16 -04:00
Tim Pope
35f1095f9b Expose completion helpers for subcommands 2019-09-09 19:10:24 -04:00
Tim Pope
f5fc469c0c Ignore blank buffers in fugitive#Statusline() 2019-09-06 17:16:19 -04:00
Tim Pope
cb66611f03 Remove blank buffer FAQ entry 2019-09-05 17:26:58 -04:00
Tim Pope
49287b6e87 Remove redundant autocommands 2019-09-05 16:42:39 -04:00
Tim Pope
ec918b9a79 Support blank buffers
Closes https://github.com/tpope/vim-fugitive/issues/1000
2019-09-05 15:46:27 -04:00
Tim Pope
ff0eeac045 Document disabling global maps
References https://github.com/tpope/vim-fugitive/issues/1331
2019-09-05 15:36:56 -04:00
Tim Pope
eb04d8bcc0 Standardize on "maps", not "mappings" 2019-09-05 15:35:42 -04:00
Teo Ljungberg
2d0df5842a Fix :Glog
`"<mods>"` was forgotten to be passed in during the refactoring in:
68da9a2
2019-09-04 15:54:36 -05:00
Tim Pope
1937bc3cd9 Experimental support for blank buffers 2019-09-04 15:22:28 -04:00
Tim Pope
d2837b103c Add sponsor button 2019-09-04 15:22:28 -04:00
Tim Pope
10c54dfc93 Set b:git_dir for :terminal buffers 2019-09-04 15:22:28 -04:00
Tim Pope
40bc5aff18 Make universal maps global 2019-09-04 15:11:59 -04:00
Tim Pope
68da9a2be3 Make :Glog and :Ggrep global 2019-09-04 15:11:59 -04:00
Tim Pope
804957a3e6 Make :Gbrowse global 2019-09-04 15:11:59 -04:00
Tim Pope
cf88ce96c9 Make :Gmove and :Gremove global 2019-09-04 15:11:59 -04:00
Tim Pope
2464b0c29a Make :Gcd global 2019-09-04 15:11:59 -04:00
Tim Pope
77a732c97c Explicitly document :Git subcommands 2019-09-04 15:11:59 -04:00
Tim Pope
64d106dfdd Remove fugitive- prefix from command help topics 2019-09-04 13:17:20 -04:00
Tim Pope
c9d4ea7900 Always use Git style path for <C-R><C-G> 2019-09-04 13:17:20 -04:00
Tim Pope
99ad1a89fa Relocate 'path' adjustment
I'm not sure where we should do this (if at all), but after loading the
appropriate buffer (and thus applying the file type) is a better place
than during general activation.
2019-09-04 13:17:20 -04:00
Tim Pope
2eb6aac0c4 Adjust warning wording 2019-09-04 13:17:20 -04:00
Tim Pope
c80ffaf073 Don't override user :Gr 2019-09-04 13:17:20 -04:00
Tim Pope
63a05a6935 Remove 'tags' support 2019-09-03 21:40:39 -04:00
Tim Pope
522d3d3c1e Make edit commands global 2019-09-03 20:21:47 -04:00
Tim Pope
b8c33aa0a1 Enable edit commands to work without git dir 2019-09-03 20:20:37 -04:00
Tim Pope
39f9e2d722 Move IO functions with rest of API 2019-09-03 20:20:37 -04:00
Tim Pope
a45e2c6d57 Provide :Gr as alias for :Gread 2019-09-02 19:58:13 -04:00
Tim Pope
5042fd965d Tweak :Gedit > semantics
Treat ~ and ^ suffixes as relative to current commit, not HEAD, and use
a bare > to get to the work tree version.
2019-09-02 19:58:13 -04:00
Tim Pope
251eda7eb6 Reduce fugitive#buffer() to stub object 2019-09-01 21:48:16 -04:00
Tim Pope
c212d854d5 Accommodate git-blame revision ignoring features
Closes https://github.com/tpope/vim-fugitive/issues/1316
2019-09-01 12:56:58 -05:00
Tim Pope
082a9b99e7 Remove double word in docs 2019-09-01 12:56:58 -05:00
Tim Pope
c13e0e1afd Don't browse to blob for empty buffer 2019-08-31 22:34:34 -04:00
Tim Pope
b97a9abe29 Provide global :Git and :G 2019-08-22 19:46:20 -05:00
Tim Pope
410e17129d Use :Git not :G for visible maps
Let's treat :Git as canonical and :G as the shorthand.
2019-08-22 19:45:20 -05:00
Tim Pope
3a01f4b819 Remove toggling behavior of :Gblame
References https://github.com/tpope/vim-fugitive/issues/1316
2019-08-22 19:15:43 -05:00
Tim Pope
f04a2275db Remove feedkeys() contortions in :Gdiffsplit
Closes https://github.com/tpope/vim-fugitive/issues/1313
2019-08-21 15:14:39 -05:00
Tim Pope
b714adbc51 Fix q deprecation message 2019-08-21 09:12:17 -05:00
Tim Pope
9abe962c9d fugitive.vim 3.0
* Use custom format for :Gstatus, not literal git status output.
* Inline diffing in :Gstatus, with support for staging individual hunks.
* List unpushed and unpulled commits in :Gstatus.
* Show rebase status in :Gstatus.
* Greatly expanded set of mappings in :Gstatus. Try g?, c?, and r?.
* :Gstatus p (add --patch) is changed to P.
* :Gstatus U (checkout/clean) is changed to X. New U behavior is global reset.
* :Gstatus 2X/3X performs checkout --ours/--theirs.
* :Gstatus gI ignores file.
* Smarter :Gstatus automatic reload.
* :Git subcommand calls :Gsubcommand when appropriate.
* :Git add --patch and similar commands use :terminal.
* :Git diff, :Git log, and :Git --no-pager display results in temp buffer.
* :Git and subcommand wrappers use custom quoting rather than shell escaping.
* :Git ... ./path is relative to working directory.
* Add --option completion to :Git and git wrappers.
* Provide :G as wrapper for both :Gstatus and :Git.
* Support for :Grebase --interactive.
* :Gblame accepts all arguments, including filenames and commits.
* Support :Gblame --reverse to navigate forwards through history.
* Support :Gblame with range to blame subset of current file.
* Allow disabling dynamic blame colors with let g:fugitive_dynamic_colors = 0.
* :Glog opens quickfix list instead of displaying raw log output.
* Cleaner :Glog quickfix list leveraging Vim's new "module" format.
* :Glog no longer defaults to current file.  Use :0Glog for that.
* :0Glog follows file across renames.
* :Glog name softly deprecated in favor of :Gclog (named after :cfile).
* Provide :Grevert.
* :Gdiff renamed to :Gdiffsplit.
* :Gdiffsplit always opens one window.  Use :Gdiffsplit! for conflicts.
* Support git grep --column.
* Chdir with git -C rather than :cd for most commands. (Git 1.8.5 required)
* Show all stderr hook output on :Gcommit.
* Provide core.askPass default for Gpush and friends.
* Require bang to :Gwrite from index.
* Bug fixes.
* Polish.
2019-08-20 10:06:56 -04:00
Tim Pope
b6bbb17e3f Expose IO functions as object
This is a new interface to a slightly older API for performing standard
VimL IO functions against URLs (or any other URLs, the interface is
generic).  Example wrapper function:

       function! IO(fn, ...) abort
         let file = a:fn ==# 'writefile' ? a:2 : a:1
         let obj = get(g:, 'io_' . matchstr(file, '^\a\a\+'), {})
         return call(get(obj, a:fn, a:fn), a:000)
       endfunction
       echo IO('filereadable', @%)
2019-08-20 08:51:52 -04:00
Tim Pope
9dcf1d7d81 Document important API functions 2019-08-20 08:51:52 -04:00
Tim Pope
a510b3aadf Deprecate :Gstatus q 2019-08-20 08:51:52 -04:00
Tim Pope
c63fd1b71b Support a...b as notation for merge base
Closes https://github.com/tpope/vim-fugitive/pull/913
2019-08-19 11:25:39 -04:00
Tim Pope
e768806266 Remove obsolete Git object examples 2019-08-19 11:22:52 -04:00
Tim Pope
f29298880f Provide FugitiveGitPath() 2019-08-19 09:04:32 -04:00
Tim Pope
2b6199594a Use FugitiveVimPath() to normalize directories during detection 2019-08-19 09:04:32 -04:00
Tim Pope
fd7b5d8a1e Rename s:PlatformSlash() to FugitiveVimPath() 2019-08-19 08:41:15 -04:00
Tim Pope
e759a85486 Provide separate highlight groups for file sections
References https://github.com/tpope/vim-fugitive/issues/1159
2019-08-19 08:05:22 -04:00
Tim Pope
85ffe4754e Remove dead code 2019-08-19 06:42:44 -04:00
Tim Pope
c242cb6369 Provide maps to find similar diff lines 2019-08-18 10:53:21 -04:00
Tim Pope
ff058bf5b7 Fix diff after :Gwrite
This works around a bug in Vim that was fixed in patch 8.0.0421.

Closes https://github.com/tpope/vim-fugitive/issues/1102

References https://github.com/tpope/vim-fugitive/pull/859
2019-08-18 10:53:20 -04:00
Tim Pope
ed6f4256fc Change work tree buffer on :Gwrite exactly once 2019-08-18 09:11:10 -04:00
Tim Pope
1c22b69652 Remove dp map in blobs
The built-in is actually useful so don't shadow it.
2019-08-18 09:11:10 -04:00
Tim Pope
52f71a3154 Follow renames on :0Gclog
Closes https://github.com/tpope/vim-fugitive/issues/563
2019-08-18 07:18:17 -04:00
Tim Pope
fdbcad0624 Allow expanding merge conflict in :Gstatus
Closes https://github.com/tpope/vim-fugitive/issues/1242
2019-08-18 04:58:59 -04:00
Tim Pope
bbd9afe790 Provide map to close diff buffers 2019-08-18 04:58:59 -04:00
Tim Pope
f2ca0e43a1 Give s:MapEx() more intention revealing name 2019-08-18 04:58:59 -04:00
Tim Pope
25581bf775 Support discarding multiple changes in visual mode
Closes https://github.com/tpope/vim-fugitive/issues/944
2019-08-18 01:51:38 -04:00
Tim Pope
e69a3ea21a Add nested to reload status autocommands
References https://github.com/tpope/vim-fugitive/pull/889
2019-08-17 08:43:21 -04:00
Tim Pope
442d56e23c Fix :Glog 2019-08-16 13:48:46 -04:00
Daniel Hahler
cb613ca05d Fix :Gdiffsplit with diffopt+=vertical
Only remove "vertical" from `&diffopt` after calling
`s:diff_modifier()`.

Regressed in c972b2a.
References https://github.com/tpope/vim-fugitive/pull/805#issuecomment-522057790.
2019-08-16 13:40:53 -04:00
Tim Pope
d6f7eaf16c Compensate for 'noequalalways' in merge diff
Closes https://github.com/tpope/vim-fugitive/issues/674
2019-08-16 07:08:05 -04:00
Tim Pope
b6dbe402e8 Fix :Glog with diff.noprefix set
Closes https://github.com/tpope/vim-fugitive/issues/606
2019-08-16 07:08:05 -04:00
Tim Pope
86c276d629 Fix version check for doautocmd <nomodeline> 2019-08-16 07:08:05 -04:00
Felix Archambault
22e9b26075 doc: prefer https url 2019-08-15 22:59:49 -04:00
Tim Pope
2518ef9a02 Map double click to jump to file
References https://github.com/tpope/vim-fugitive/pull/620
2019-08-15 22:58:37 -04:00
Tim Pope
bb82255490 Add :help reference to README 2019-08-15 22:46:36 -04:00
Tim Pope
a8163625f8 Vim automatically sets cursorbind for diff buffers
References https://github.com/tpope/vim-fugitive/pull/937
2019-08-15 22:39:04 -04:00
Tim Pope
7079d0c7e2 Convert all FugitivePrepare() int arguments to buffer names 2019-08-15 22:01:27 -04:00
Tim Pope
4f51d99f44 Encapsulate shell escaping user arguments 2019-08-15 22:01:27 -04:00
Tim Pope
c972b2a065 Fix :Ghdiffsplit with diffopt=vertical
Closes https://github.com/tpope/vim-fugitive/issues/990
2019-08-15 19:40:46 -04:00
Tim Pope
cf9ef7377f Don't process modelines after :Gwrite
Closes https://github.com/tpope/vim-fugitive/issues/956
2019-08-15 17:53:27 -04:00
Tim Pope
45ca1eab83 Use platform slashes for :Gcd
The only current difference is backslashes on Windows, which aren't
required, but this may evolve into larger changes in the future.
2019-08-15 17:53:27 -04:00
Tim Pope
a80b965d0d Remove legacy support for /relative/path 2019-08-15 17:53:27 -04:00
Tim Pope
03361373b1 Fix :Gstatus U map 2019-08-15 17:53:13 -04:00
Tim Pope
6a04e875f8 Provide diff maps in blobs 2019-08-15 11:49:54 -04:00
Tim Pope
557cc74141 Fix syntax error
Closes https://github.com/tpope/vim-fugitive/issues/1310
2019-08-15 11:49:54 -04:00
Tim Pope
b887de5ce2 Don't reuse blame buffers for Gstatus edits 2019-08-15 03:47:13 -04:00
Tim Pope
6cc52a1aab Fix extra bang in diff maps 2019-08-15 03:47:13 -04:00
Tim Pope
faa895239b Clean up gitdir file parsing 2019-08-15 03:34:00 -04:00
Tim Pope
6eb885c017 Always diff against parents in :Gdiffsplit! 2019-08-14 11:06:42 -04:00
Tim Pope
308e4bf241 Fix temp file gq shadowing blame gq 2019-08-14 09:38:39 -04:00
Tim Pope
7d484eaf52 Use s:Map() for nearly all maps 2019-08-14 09:38:39 -04:00
Tim Pope
34bfcd471b Fix error generating command for :'<,'>Gblame
Closes https://github.com/tpope/vim-fugitive/issues/1308
2019-08-14 09:38:39 -04:00
Tim Pope
1d2821f91e Clarify :Gstatus p behavior
I've seen a lot of confusion in the wild around this, and the old
behavior is immortalized in the Vimcasts.  Lets make this an error while
we regroup.
2019-08-14 01:44:13 -04:00
Tim Pope
53e5e61afa Emphasize :Glog behavior change
Let's go ahead and embrace :Gclog as a warning free version of the
command.
2019-08-14 01:44:13 -04:00
Tim Pope
1359d620eb Force <nowait> for all generated maps 2019-08-13 23:32:50 -04:00
Tim Pope
5defa72b81 Provide count on blob blame maps for --reverse 2019-08-13 21:31:01 -04:00
Tim Pope
c21736dde7 Jump to file not diff for boundary commit in :Gblame 2019-08-13 21:31:01 -04:00
Tim Pope
11691b38bb Allow :Gblame ^boundary to use scrollbind 2019-08-13 21:31:01 -04:00
Tim Pope
69bf0e3469 Accept commit.. :Gblame argument as commit not filename 2019-08-13 20:58:10 -04:00
Tim Pope
e7c2563288 Remove bang variant of :Git from README
This happens for the important commands automatically, and the new
override syntax is -P/--no-pager.
2019-08-13 19:44:17 -04:00
Tim Pope
c0ce201c3b Remove :Git --paginate from docs
I thought the --paginate option was basically the opposite of
--no-pager, but it actually forces the entire command to run through a
pager, breaking a lot of interactive commands.  Let's de-emphasize it as
a solution.
2019-08-13 19:44:17 -04:00
Tim Pope
49b777ae44 Use rev-list in lieu of log with raw format 2019-08-13 17:24:17 -04:00
Tim Pope
f33a53bceb Remove debug 2019-08-13 17:20:56 -04:00
Tim Pope
16bfd4fa92 Fix offset jumping to patch on :Gblame --reverse 2019-08-13 17:20:03 -04:00
Tim Pope
8038ee60a9 Fix -1 effectively canceling --reverse
Is there a way to apply a limit at the print level rather than the query
level?
2019-08-13 17:12:28 -04:00
Tim Pope
08a9a45dbc Support :rightbelow Gblame and other <mods>
Closes https://github.com/tpope/vim-fugitive/issues/976
2019-08-13 16:27:28 -04:00
Tim Pope
0a7ffc5d67 Use descendant when jumping to patch for :Gblame --reverse
References https://github.com/tpope/vim-fugitive/issues/1305
2019-08-13 16:27:28 -04:00
Tim Pope
0392f64a93 Make :Gblame a proper subcommand 2019-08-13 15:28:01 -04:00
Tim Pope
d1033e756e Cleaner error on -z command failure 2019-08-13 15:28:01 -04:00
Tim Pope
79b1f16a7a Delegate :Git grep to :Ggrep 2019-08-12 00:12:18 -04:00
Tim Pope
03710a877a Use same window for commit message on :0Gcommit 2019-08-12 00:12:18 -04:00
Tim Pope
b4d40abb10 Use lower case for subcommand declarations 2019-08-11 22:36:29 -04:00
Tim Pope
3ca888470b Expand diffs on :Gcommit --patch 2019-08-11 22:36:29 -04:00
Tim Pope
4460aeffdd Use temp buffer with man filetype for :Git help 2019-08-11 18:40:25 -04:00
Tim Pope
078210c718 Use temp buffer for :Git show and :Git stash show 2019-08-11 18:40:24 -04:00
Tim Pope
d417fd3199 Move blame buffer settings to FileType event
The goal here is to extract just the settings that would work outside of
a vertical split with 'scrollbind' in effect, so we can one day add a
second mode.
2019-08-11 17:33:45 -04:00
Tim Pope
4daa0c558c Support nearly all git-blame flags 2019-08-11 01:17:22 -04:00
Tim Pope
7686b7dc5c Support blame.blankBoundary with Ignore highlight 2019-08-11 01:03:09 -04:00
Tim Pope
68f0cb87a9 Don't require <mods> for vertical/tab blame culprit maps 2019-08-11 01:03:09 -04:00
Tim Pope
9ca6e0c633 Remove q from :Gblame documentation 2019-08-10 22:24:35 -04:00
Tim Pope
97e993611e Highlight blame --score-debug and blame -c 2019-08-10 22:24:35 -04:00
Tim Pope
54f155218a Remove duplicate b:fugitive_status initialization 2019-08-10 22:24:35 -04:00
Tim Pope
c7e3df5283 Provide some commit --reset-author maps
Supporting flags with additional maps is a pretty limited solution, as
there's no way to combine them (that is, we'd need to map both cRva and
cvRa to get both verbose and reset-author, and that's as silly as it is
hard to type in under a second).  I think some kind of getchar()
dispatcher is going to be the long term solution.
2019-08-10 22:24:35 -04:00
Tim Pope
bc3d36e559 Remove 'guioptions' workaround 2019-08-09 00:51:59 -04:00
Tim Pope
8227503714 Open :Gstatus for :Gcommit -i and :Gcommit -p 2019-08-09 00:33:28 -04:00
Tim Pope
f0acf3e883 Show dirty submodules in Unstaged section
Closes https://github.com/tpope/vim-fugitive/issues/1204
2019-08-09 00:33:28 -04:00
Tim Pope
a09e49d2bb Support :Gblame --reverse
Closes https://github.com/tpope/vim-fugitive/issues/1305
2019-08-08 21:02:40 -04:00
Tim Pope
cce9ca0933 Move select temp file configuration to BufReadPre
This allows the natural machinery to kick in rather than invoking
FugitiveDetect() and fugitive#MapJumps() explicitly.
2019-08-08 21:02:40 -04:00
Tim Pope
0a536ed5af Don't unnecessarily change ":verbose set scrollbind?" 2019-08-08 20:24:40 -04:00
Tim Pope
9420d05ddd Eliminate b:fugitive_blamed_bufnr 2019-08-08 20:24:40 -04:00
Tim Pope
6db7120c9a Don't double set temp options on blame buffer 2019-08-08 20:24:40 -04:00
Tim Pope
4a42d4e21c Encapsulate retrieval of blamed bufnr 2019-08-08 20:24:40 -04:00
Tim Pope
206b54a147 Retool :Gblame close map 2019-08-08 20:24:40 -04:00
Tim Pope
1260de3b7d Fix :Gread blobhash
References https://github.com/tpope/vim-fugitive/issues/836
2019-08-08 18:15:39 -04:00
Tim Pope
9d36dc2d74 Check for built-ins with .exe extension on Windows 2019-08-08 01:44:44 -04:00
Tim Pope
0db4ceb980 Restore press enter prompt in :Ggrep in GUI 2019-08-07 19:31:35 -04:00
Tim Pope
95c1f1525d Fix accidental utility invocation on :Git complete 2019-08-07 18:12:07 -04:00
Tim Pope
cfca94c723 Expand simple aliases in :Git
This lets you alias ca = `git commit -a` and have `:Git ca` call
`:Gcommit -a`.
2019-08-07 17:31:14 -04:00
Tim Pope
edae34e02f Fix count with jump to commit section 2019-08-07 00:52:38 -04:00
Tim Pope
d7172882b7 Add default core.askPass to :Gpull 2019-08-06 20:01:18 -04:00
Tim Pope
511e32114b Swap gu and gU 2019-08-06 19:39:26 -04:00
Tim Pope
0cc3beeae9 Tweak commit for u rebase map 2019-08-06 14:32:39 -04:00
Tim Pope
0484c03c6b Allow :Grevert --abort/continue/quit 2019-08-06 14:10:45 -04:00
Tim Pope
9d77fd566c Add Git dir presence guard to all commands
This isn't necessary for the current implementation, but could enable
making the commands (or at least the underlying commands) global.
2019-08-06 14:10:45 -04:00
Tim Pope
35d7590354 Provide s/u mappings on commits
I need to figure out the big picture push story before I can document
the push maps.
2019-08-06 14:10:38 -04:00
Tim Pope
c4d4986f1e Delegate :G command to :Gcommand for 8 commands 2019-08-04 00:05:18 -04:00
Tim Pope
fb9acc6831 Add a FAQ entry about remote passwords 2019-08-03 21:38:28 -04:00
Tim Pope
81eec879a4 Update :Gstatus description in README 2019-08-03 21:38:28 -04:00
Tim Pope
14effe7bfb Mention :Gpull and related commands in README 2019-08-03 21:38:28 -04:00
Tim Pope
15fe543508 :Glog isn't that exciting 2019-08-03 21:38:28 -04:00
Tim Pope
bd70719f54 Provide :Grevert and :Gmerge mappings 2019-08-03 21:38:28 -04:00
Tim Pope
0f08b0cbbb Provide separate file/hunk jump maps 2019-08-03 16:27:44 -04:00
Tim Pope
35cf80dd3b Fix :Gbrowse with range and blame.coloring enabled 2019-08-03 16:27:03 -04:00
Tim Pope
dffa56c4ea Retool section jump maps 2019-08-03 00:52:08 -04:00
Tim Pope
9ac6a258d6 Fall back to "commit" line for file hunk jump maps
This enables jumping from commit to commit in :Git log.
2019-08-02 23:41:57 -04:00
Tim Pope
e5a6a8c525 Support jump maps in visual mode 2019-08-02 20:21:23 -04:00
Tim Pope
875a58c2e1 Document :Git --paginate
Was planning on keeping this unofficial, but I think we need to provide
an alternative to loading :Git log in a temp file.
2019-08-02 20:21:23 -04:00
Tim Pope
3f417d7ad1 Enable fixup/squash maps in :Git log 2019-08-02 20:21:23 -04:00
Tim Pope
2b757e87d5 Disable modelines in temp files 2019-08-02 20:21:23 -04:00
Vais Salikhov
5af58f9da1 Fix a typo in the docs 2019-08-02 15:25:40 -04:00
Tim Pope
4c0dbb66eb Always use temp file for :Git diff and :Git log
You can use :Git -p log to get a terminal instead.
2019-08-02 13:31:55 -04:00
Tim Pope
9118ed27c3 Add -addr= declarations 2019-08-02 13:26:18 -04:00
Tim Pope
291cf5d1bc :0Ggrep calls :Glgrep 2019-08-02 13:17:08 -04:00
Tim Pope
928e1e71e7 Document :Git --no-pager 2019-08-02 02:00:16 -04:00
Tim Pope
b9c47cec52 Add command dispatcher
This will enable cleaning up some of the repetition in argument and
exception handling
2019-08-02 01:45:33 -04:00
Tim Pope
21991bcbaf Eliminate redundant :G and :Git implementations 2019-08-02 01:09:20 -04:00
Tim Pope
665cec73d9 Provide :Grevert 2019-08-01 23:22:10 -04:00
Tim Pope
d54e98bedb Remove overlooked 40 character limits 2019-08-01 23:22:10 -04:00
Tim Pope
0ab2d9709c Preserve cursor position after staging last untracked file 2019-08-01 19:27:41 -04:00
Tim Pope
7df9f07e1f Compensate for blame.coloring
Closes https://github.com/tpope/vim-fugitive/issues/1301
2019-08-01 12:46:45 -04:00
Tim Pope
fb3c603ce6 Always use temp file for :Git --no-pager 2019-08-01 12:46:09 -04:00
Tim Pope
44ade58ed5 Always use :terminal for :Git --paginate
References https://github.com/tpope/vim-fugitive/issues/1294
2019-07-30 13:05:16 -04:00
Tim Pope
881d72f1af Preserve index on cza and czp 2019-07-29 17:16:58 -04:00
Tim Pope
f3dde245b3 Map I to :Git add --intent-to-add 2019-07-29 17:16:58 -04:00
Tim Pope
a3ab24f681 Fire synthetic QuickFix events on :Ggrep
References https://github.com/tpope/vim-fugitive/issues/1297
2019-07-29 13:23:59 -04:00
Tim Pope
bd89fd440b Fix error message for rev-parse 2019-07-29 00:48:57 -04:00
Tim Pope
3c4ad5ff72 Avoid unnecessary diffing in :Gstatus 2019-07-28 21:50:49 -04:00
Tim Pope
fff24e29e6 Add czA and czP aliases for cza and czp
One set of these will get --index.  I'll decide which later.
2019-07-28 21:50:49 -04:00
Tim Pope
0810dcc805 Fix typo 2019-07-28 20:42:37 -04:00
Tim Pope
3b0f68180f Compensate for bad 'shellredir' 2019-07-28 19:21:01 -04:00
Tim Pope
49f3f92fd5 Guard against inadvertent :| invocation
I haven't been able to consistently reproduce it, but sometimes vim
takes :edit +CmdA\|CmdB to mean :CmdA followed by :| and not :CmdA
followed by :CmdB.
2019-07-28 19:16:28 -04:00
Tim Pope
645406f592 Use :Gdiffsplit! for diff maps
This opens a 3 way diff for merges and also focuses the more useful
window.
2019-07-28 01:20:38 -04:00
Tim Pope
7bfce97480 Provide misc :Git mappings 2019-07-28 01:12:33 -04:00
Tim Pope
3e9ef9349d Remove error guards for old object syntax 2019-07-28 01:10:37 -04:00
Tim Pope
881ad1ed0b Guard against missing output on :Gcommit success 2019-07-26 21:56:39 -04:00
Tim Pope
ebc3f35575 Require bang to :Gwrite from index
Closes https://github.com/tpope/vim-fugitive/issues/1057
2019-07-26 11:32:24 -04:00
Tim Pope
79566b5ddd Don't override alt buffer on :Gwrite from index 2019-07-26 11:32:24 -04:00
Tim Pope
d90e912e46 Provide ignoring maps
Closes https://github.com/tpope/vim-fugitive/issues/235
2019-07-24 21:27:16 -04:00
Tim Pope
2bfb6e9889 Reverse inline diff mappings
References https://github.com/tpope/vim-fugitive/issues/1199
2019-07-24 21:27:16 -04:00
Tim Pope
b92de0138d Provide rudimentary stash mappings 2019-07-23 20:44:25 -04:00
Tim Pope
d95cc5f8c2 Remove :Gedit HEAD and :Gedit refs/... special cases 2019-07-23 20:44:25 -04:00
Tim Pope
55cb58cd5f Add :Git add --intent-to-add to :Gstatus P 2019-07-23 20:44:24 -04:00
Tim Pope
ce283cbdbf Remove i special behavior on section heading 2019-07-23 20:10:48 -04:00
Tim Pope
994d1b518f Remove --intend-to-add from :Gstatus i
You can't actually apply a hunk to a file added with --intend-to-add, so
this did not pair well with the hunk expansion behavior.
2019-07-23 19:37:06 -04:00
Tim Pope
d88a0f8465 Fix :Gstatus X in visual patch selection 2019-07-23 19:24:07 -04:00
Tim Pope
54bc4ab9dd Improve error handling on :Gstatus X 2019-07-23 18:29:13 -04:00
Tim Pope
15df3f8959 Do what the user means for LANG= in g:fugitive_git_executable 2019-07-23 15:13:28 -04:00
Tim Pope
1fe6202848 Fix :Gbrowse assuming range 2019-07-22 15:20:21 -04:00
Tim Pope
a152894a55 Don't rely on exception message for :Gbrowse - error 2019-07-22 14:34:46 -04:00
Tim Pope
8a693fb7bc Restore :Gdiffsplit :n 2019-07-22 14:34:45 -04:00
Tim Pope
80996c2e2c Map c? and r? to show commit and rebase help 2019-07-21 15:27:21 -04:00
Tim Pope
238a5d8aaf Map U as :Git reset -q 2019-07-21 15:27:20 -04:00
Tim Pope
76bd7d6cb4 Map gr to jump to rebasing section 2019-07-21 15:26:58 -04:00
Tim Pope
ac97fa3781 Use terminal for :Git fetch/pull/push
I consider :Gfetch, etc, the proper interface, but allow this as a
backdoor.

References https://github.com/tpope/vim-fugitive/issues/1292
2019-07-21 15:26:47 -04:00
Tim Pope
6e2310a154 :Gstatus called from status window forces reload 2019-07-20 23:36:42 -04:00
Tim Pope
387cb5c2a0 Clean up error reporting on :Gwrite in diff 2019-07-20 23:36:42 -04:00
Tim Pope
8d584c199a Fix escaping for :Ggrep '#' 2019-07-20 23:36:42 -04:00
Tim Pope
adba9c6345 Provide core.askPass default
Closes https://github.com/tpope/vim-fugitive/issues/722
2019-07-18 16:23:01 -04:00
Tim Pope
d68efa32e8 Document parentheses movement maps 2019-07-18 14:18:09 -04:00
Tim Pope
b0de6c2811 Fix :0Glog another/path 2019-07-18 14:18:09 -04:00
Tim Pope
e25a214f78 Add an error about LANG= in g:fugitive_git_executable 2019-07-18 11:12:03 -04:00
Tim Pope
ea26a94bde Consistently position cursor on :Gstatus 2019-07-18 11:12:03 -04:00
Tim Pope
3d305c75a0 Don't print current line on :G|chainedcommand 2019-07-18 11:12:03 -04:00
Tim Pope
68b999bfd0 Remove <C-W>C map
It's not worth claiming a whole map just to save one key press.
2019-07-18 11:12:03 -04:00
ganziqim
58b2b85c9e Only check bdelete mapping in normal mode 2019-07-18 09:44:14 -04:00
Tim Pope
07661dc102 Provide additional commit maps 2019-07-16 16:36:58 -04:00
Tim Pope
2992275d8e Don't load first quickfix result into status buffer 2019-07-16 16:36:58 -04:00
Tim Pope
d8acfc35c7 Clarify in error message that :Gbrowse handlers are user installed 2019-07-16 16:36:58 -04:00
Tim Pope
0ee0498b88 Filter out warning on :Gedit master@{2.years.ago} 2019-07-16 16:00:09 -04:00
Tim Pope
469a73f3d9 Speed up :Ggrep 2019-07-15 22:41:51 -04:00
Tim Pope
a1b78969f5 Decouple :Glog from :grep
One step closer to asynchronous job support.
2019-07-15 22:41:51 -04:00
Tim Pope
158ffdbb14 Extract function to create titled quickfix list 2019-07-15 22:41:51 -04:00
Tim Pope
f83072703b Remove debugging variable 2019-07-15 22:41:35 -04:00
Tim Pope
4c650c699d Don't require shell quoting for colons
References https://github.com/tpope/vim-fugitive/issues/1289
2019-07-15 15:35:02 -04:00
Tim Pope
dafb994c92 Remove unused function 2019-07-14 14:29:26 -04:00
Tim Pope
8c80cb63e2 Fix E211 handling in :Gmerge/:Grebase 2019-07-14 14:29:26 -04:00
Tim Pope
dbdc947533 Fix <CR> as :Gblame map 2019-07-14 14:29:26 -04:00
Tim Pope
4da9fb8f43 Guard against empty filename checking for conflicts
Closes https://github.com/tpope/vim-fugitive/issues/1287
2019-07-13 07:50:11 -04:00
Tim Pope
0c259e3016 Tighten up autowrite handling 2019-07-13 07:50:11 -04:00
Tim Pope
d0049b4417 Support double quotes for all subcommand wrappers 2019-07-12 09:20:13 -04:00
Tim Pope
e169595314 Fix finishing :Gcommit on :wqa
This was added to compensate for the implicit autowrite we lost when
switching from :! to system(), but it seems calling in the
VimLeavePre/BufLeave event prevents the commit from happening on exit.
I don't fully understand it but it's easy to prevent.

Closes https://github.com/tpope/vim-fugitive/issues/1285
2019-07-12 09:20:13 -04:00
Tim Pope
a1a40c360d Provide :Gclog and :Gcgrep aliases
The distant future might hold a :Glog command that isn't bound by the
limitations of the quickfix list, so introduce an alias for the quickfix
variant to retire to.

:Gcgrep is a weird name since it directly maps to :grep, but provide it
anyways for symmetry.
2019-07-11 17:34:25 -04:00
Tim Pope
e250f9730e Fix :Gblame on win32
Closes https://github.com/tpope/vim-fugitive/issues/1284
2019-07-11 17:34:25 -04:00
Tim Pope
c33d7fcb9f Show stderr on :Gcommit
References https://github.com/tpope/vim-fugitive/pull/1115
2019-07-11 12:32:35 -04:00
Tim Pope
d176cca5ae Don't include trailing newline in fugitive#GitVersion() 2019-07-11 12:32:35 -04:00
Tim Pope
aa68223376 More helpful error on Git without -C
Closes https://github.com/tpope/vim-fugitive/issues/1283
2019-07-11 07:56:28 -04:00
Tim Pope
bdf5a221fb Use standard argument handling for :Gfetch/:Gpush 2019-07-10 14:51:56 -04:00
Tim Pope
fd48cde3b7 Fix escaping when :Grebase calls :Gcommit 2019-07-10 14:51:56 -04:00
Tim Pope
0a758c22b3 Retool :Ggrep 2019-07-10 08:22:49 -04:00
Tim Pope
bb05732d7f Begin phasing out <line2> 2019-07-10 08:22:49 -04:00
Tim Pope
de3f6d977c Fix commands on Vim without <mods>
Closes https://github.com/tpope/vim-fugitive/issues/1282
2019-07-09 19:26:44 -04:00
Tim Pope
5f9602e12f Also support :G command commit:./path 2019-07-09 13:30:07 -04:00
Tim Pope
9afa926a23 Fix subcommand completion to match :Git completion 2019-07-09 13:30:07 -04:00
Tim Pope
23138572f4 Fix :[range]Glog
Closes https://github.com/tpope/vim-fugitive/issues/1280
2019-07-09 13:30:07 -04:00
Tim Pope
ad2e408e15 Treat :G ... ./path as relative to working directory
References https://github.com/tpope/vim-fugitive/issues/504
2019-07-09 12:26:57 -04:00
Tim Pope
f38c59af7c Better error handling for obsolete argument syntax 2019-07-09 12:03:22 -04:00
Tim Pope
6b1e749849 Eliminate :cd in :Gread! and :Gblame 2019-07-09 12:03:22 -04:00
Tim Pope
2ddf4e97ef Work around broken nvim reltime()
Closes https://github.com/tpope/vim-fugitive/issues/1277
2019-07-09 12:03:22 -04:00
Tim Pope
fb66f9a86d Set loclist not qflist title for :Gllog 2019-07-09 12:02:53 -04:00
Tim Pope
9556e59765 Fix :Glog on Vim without quickfix "module" support
Closes https://github.com/tpope/vim-fugitive/issues/1279
2019-07-09 12:02:53 -04:00
Tim Pope
b48f93b550 Use proper argument parsing for :Glog 2019-07-09 06:45:58 -04:00
Tim Pope
0a4eee76e9 Don't hide :Glog errors 2019-07-09 06:45:58 -04:00
Tim Pope
1fb7fa0078 Use correct quickfix commands for :Gllog 2019-07-09 06:45:58 -04:00
Tim Pope
5c3d30223b Further tighten :Glog format 2019-07-09 06:45:58 -04:00
Tim Pope
d22a14192f Don't map file/hunk jumps in blobs 2019-07-09 06:45:58 -04:00
Tim Pope
f71a38db7d Fix argument handling for :Gmerge
This shouldn't matter in practice since :Gmerge doesn't accept path
arguments, but may as well do the right thing.
2019-07-09 06:45:58 -04:00
Tim Pope
cecfc06be3 Tweak s:Dir() usage 2019-07-09 06:45:58 -04:00
Tim Pope
102b3a50e2 Support next/previous file/hunk in commits
One of these aliases is going to end up being for files only but I'll
decide which later.
2019-07-08 15:40:47 -04:00
Tim Pope
ebd7c9ddd3 Add next/previous section maps 2019-07-08 15:39:51 -04:00
Tim Pope
45fd3f4cb8 Change interface for jumping directly to blame commit 2019-07-08 15:39:51 -04:00
Tim Pope
eaa0764940 Fix false positve matching :Glog abbreviated SHA 2019-07-08 15:39:51 -04:00
Tim Pope
85a135a9b0 Complete options for subcommand wrappers
Closes https://github.com/tpope/vim-fugitive/issues/1265
2019-07-08 10:04:58 -04:00
Tim Pope
cd78a08543 Retool diffing
Support mods, rename to match the built-in :diffsplit, and (perhaps
controversially) move three-way diffing to the bang variant, so that the
default behavior always focuses the other window.

Closes https://github.com/tpope/vim-fugitive/pull/715
2019-07-08 10:04:58 -04:00
Tim Pope
e49b9a9303 Pass bang to :Gblame to get horizontal split
Closes https://github.com/tpope/vim-fugitive/issues/1183
2019-07-08 09:41:08 -04:00
Tim Pope
362ce47ed1 Force hyphen in :Gblame -opts
I want to change the interface to allow passing an optional filename.
2019-07-08 09:41:08 -04:00
Tim Pope
668a615559 DWIM for :(top)/absolute/path 2019-07-08 09:41:08 -04:00
Tim Pope
6b02026cf9 Fix :Gblame <CR> with existing q map 2019-07-08 09:41:08 -04:00
Tim Pope
bfe74225fa Use :terminal for :Git add --patch and similar commands 2019-07-08 03:54:06 -04:00
Tim Pope
2cde9172a9 Add section jump maps
References https://github.com/tpope/vim-fugitive/issues/1252
2019-07-08 03:50:49 -04:00
Tim Pope
e0d4a281a8 Remove transitional g| mapping 2019-07-07 16:38:45 -04:00
Tim Pope
985861c083 Unify :G and :Git
The principle difference between these two is that :G uses -bar while
:Git fakes it.  Faking it enables double quotes, but I don't really
trust it.
2019-07-07 14:27:37 -04:00
Tim Pope
d0212919f3 Only map q if no conflict 2019-07-07 14:27:37 -04:00
Tim Pope
7e91b47021 Move blame syntax to separate file 2019-07-07 14:03:38 -04:00
Tim Pope
2b5fdf146a Allow disabling dynamic blame colors
Closes https://github.com/tpope/vim-fugitive/pull/986
2019-07-07 13:38:35 -04:00
Tim Pope
abefcb6ebd Add --option completion to :Git
References https://github.com/tpope/vim-fugitive/issues/1265
2019-07-07 13:16:08 -04:00
Tim Pope
2c13dfff03 Fix completion on :vert Git <Tab> 2019-07-07 13:16:08 -04:00
Tim Pope
2e0570046b Remove reload map
May as well free this up now because we're running short on maps.
2019-07-07 13:16:08 -04:00
Tim Pope
73b7e5e23f Use proper argument parsing for :Gcommit 2019-07-07 06:39:29 -04:00
Tim Pope
e7f272a36c Change :Git! to split by default 2019-07-07 01:41:55 -04:00
Tim Pope
20bdfee4b7 Extract :Gsplit! implementation 2019-07-06 13:48:23 -04:00
Tim Pope
a50e072587 Fix handling of bar in argument parsing 2019-07-06 13:48:23 -04:00
Tim Pope
2fdba349f5 Make completion more robust 2019-07-06 13:20:15 -04:00
Tim Pope
aa41caf6c7 Lay groundwork for running commands without Git dir 2019-07-06 13:20:15 -04:00
Tim Pope
00bced7c53 Drop support for :Gblame -fn
The double dash options create false positives so this feature no longer
works correctly.
2019-07-06 13:20:15 -04:00
Tim Pope
f33ac1b2a7 Use proper argument parsing in :Gmerge/:Grebase 2019-07-06 11:19:18 -04:00
Tim Pope
2503a957ff Better helper function names for expanding split 2019-07-06 10:20:10 -04:00
Tim Pope
e87c612491 Jump to appropriate section for s/u on :Gstatus header 2019-07-06 08:56:39 -04:00
Tim Pope
0816915503 Restore popular fugitive#buffer() methods
I don't want outdated third party plugins to prevent people from
installing the upcoming stable release.
2019-07-06 08:56:39 -04:00
Tim Pope
81e57453ce Compensate for very old Vim without settabvar() 2019-07-06 08:56:39 -04:00
Tim Pope
873ede7aa4 Provide argument list version of s:UserCommand() 2019-07-06 08:56:39 -04:00
Tim Pope
d1671f1fce Fix :Gedit > 2019-07-06 08:56:39 -04:00
Daniel Hahler
48e612601b s:BuildShell: fix E706
This happens with old Vim versions (before 7.4.1546):

> Vim(let):E706: Variable type mismatch for: cmd

Ref: https://github.com/vim/vim/commit/f6f32c38b
2019-07-06 07:20:40 -04:00
Tim Pope
fdb57922a4 Update escaping for dynamic :Git invocations 2019-07-06 02:17:38 -04:00
Tim Pope
a025157c5f Don't rely on shell for quoting
Using shell syntax for Fugitive commands has a number of disadvantages:

* Commands behave differently depending on shell and platform.
* Checking for arguments (e.g., did :Ggrep receive --cached?) is
  impossible to do robustly.
* Double quoted strings conflict with -bar command chaining.
* Need to use %:S to for expansions, and backslash escaping even inside
  single quotes.

This is an experiment that instead implements the quoting ourselves.

For backwards compatibility, :Git and :Gcommit support double quoted
strings, but this is deprecated.
2019-07-06 00:55:25 -04:00
Tim Pope
3684c01ef4 Smarter :Gstatus reload 2019-07-05 10:36:06 -04:00
Tim Pope
0f46d5ce32 Don't throw exception on :Gedit :bogus 2019-07-05 10:36:06 -04:00
Tim Pope
ef820b7577 Separate argument massaging from shell quoting 2019-07-05 08:03:53 -04:00
Tim Pope
137433c3c0 Eliminate shell syntax in :Gstatus undo 2019-07-05 05:03:57 -04:00
Tim Pope
ed5ac8dc5d Fix jump to patched line in :Gstatus 2019-07-05 05:03:57 -04:00
Tim Pope
a0e8f59b68 Make :Glog a bit less insufferable
This desperately needs async job support, but until I get around to
implementing that, this will have to do.
2019-07-04 08:49:00 -04:00
Tim Pope
04c68837d3 Fix stacking untracked files 2019-07-04 08:48:54 -04:00
Tim Pope
a9572e9ea6 Fix inline diff expansion 2019-07-04 08:44:42 -04:00
Tim Pope
4466eeb47a Restore "Untracked" section 2019-07-04 07:29:08 -04:00
Tim Pope
c62d23bc18 Change s:StageInfo() to use absolute paths like s:Selection() 2019-07-04 07:29:08 -04:00
Tim Pope
51c54138ba Fix count on :Gstatus maps 2019-07-04 07:14:07 -04:00
Tim Pope
fc6643c318 Remove hard coded length limit of 40 on hashes
SHA-256 is coming eventually, may as well rip these out now.
2019-07-04 02:36:26 -04:00
Tim Pope
302ee3b41c Fix P in :Gstatus 2019-07-03 17:17:45 -04:00
Tim Pope
d238736a30 Remove weird FAQ entry 2019-07-03 06:21:52 -04:00
Tim Pope
cf5b43443f Encapsulate "-z" null splitting 2019-07-02 06:58:50 -04:00
Tim Pope
39087fed59 Encapsulate system() plus v:shell_error 2019-07-02 06:58:50 -04:00
Tim Pope
77d86594cc Encapsulate common v:shell_error usages 2019-07-02 06:58:50 -04:00
Tim Pope
17618402fa Remove :terminal special case for Neovim :Git
Neovim appears to be better about not locking up on terminal input, and
GIT_TERMINAL_PROMPT=0 gives us belt-and-suspenders protection.
2019-07-01 18:37:00 -04:00
Tim Pope
461c1beefa Fix extra space in win32 environment variables
Closes https://github.com/tpope/vim-fugitive/issues/1271
2019-07-01 17:59:25 -04:00
Tim Pope
0d6ffcc3a9 Fix docs for :0 removal 2019-07-01 05:54:55 -04:00
Tim Pope
b343a4bec0 Add error handling to s:TreeChomp() 2019-07-01 05:52:05 -04:00
Tim Pope
14649fb858 Restore autowrite before :Gcommit 2019-07-01 05:52:02 -04:00
Tim Pope
3d252dac21 Avoid use of :! in :Gcommit
References https://github.com/tpope/vim-fugitive/issues/435
2019-07-01 00:02:42 -04:00
Tim Pope
cf9c04af06 Eliminate environment juggling in :Gcommit 2019-07-01 00:02:42 -04:00
Tim Pope
74fc4b5eea Avoid intermediary v:errmsg in exception handling 2019-07-01 00:02:42 -04:00
Tim Pope
384c9e1d8e Support :tcd in initialization 2019-06-30 21:11:31 -04:00
Tim Pope
4a94b374d0 Fix bug revealing next hunk 2019-06-29 20:50:14 -04:00
Tim Pope
7c66d544e5 Only target current file if range is given to :Glog 2019-06-29 19:55:16 -04:00
Tim Pope
c8ac43422e Adjust viewport position *after* reload
References https://github.com/tpope/vim-fugitive/issues/1268
2019-06-29 19:19:09 -04:00
Tim Pope
9c195de61b Fix dd in :Gstatus staged section
References https://github.com/tpope/vim-fugitive/issues/1269
2019-06-28 14:42:01 -04:00
Tim Pope
cb4bb94f7b Fix dd in :Gstatus
Closes https://github.com/tpope/vim-fugitive/issues/1269
2019-06-28 14:31:37 -04:00
Tim Pope
198e9c4128 Improve :Gstatus support for renames
Closes https://github.com/tpope/vim-fugitive/issues/1175
2019-06-27 23:49:32 -04:00
Tim Pope
8e024f9bcc Add <mods> helper function 2019-06-27 23:49:32 -04:00
Tim Pope
192538c0a7 Fix :Gstatus overscroll when already at bottom of document 2019-06-27 23:09:34 -04:00
Tim Pope
0f20c35b62 Fix error on :Gedit with no argument 2019-06-25 16:28:36 -04:00
Tim Pope
fc529da8ae Work around autowrite bug when :terminal is open 2019-06-25 14:03:33 -04:00
Tim Pope
a0815c7010 Retire :Gedit -..., :Gedit @{...}, and :Gedit :n
I'm introducing :Gedit >... as a new shorthand because a leading > is
handled by fnameescape(), but it's very ugly, I don't think I want to
make it official.
2019-06-25 04:33:36 -04:00
Tim Pope
aff3359699 Retire :Gedit ^n and :Gedit ~n 2019-06-25 04:06:38 -04:00
Tim Pope
66a927524a Don't map <CR> in editable index buffers 2019-06-25 04:02:02 -04:00
Tim Pope
6d42c7df44 Fix fugitive#isdirectory() with trailing slash 2019-06-08 02:42:32 -04:00
Tim Pope
bf7f05e62b Accept a count to :Git
Now that <mods> support is widely available, I'm considering moving all
:Gsplit! variants onto :Git!, and making :0Git! suppress the split.
2019-06-05 22:43:31 -04:00
Tim Pope
41a734ef49 Fix Fugitive activation when historical version does not exist
I believe I omitted BufNewFile here because it seemed like kind of a
silly event for an unmodifiable, unwritable buffer, but I wasn't taking
into account that event is needed for Fugitive to activate.

Closes https://github.com/tpope/vim-fugitive/issues/1261
2019-06-03 21:06:59 -04:00
Tim Pope
a135d10967 Only activate Projectionist if config file exists
References https://github.com/tpope/vim-projectionist/issues/130
2019-06-03 00:32:19 -04:00
Tim Pope
8bbc4d8816 Eliminate repeated $GIT_DIR check 2019-06-03 00:32:19 -04:00
Tim Pope
078ffa6197 Don't assume b:git_dir is an actual directory
This is a quick first pass.  There may be others hiding.

References https://github.com/tpope/vim-fugitive/issues/776
2019-06-02 18:56:29 -04:00
Teo Ljungberg
79f3be9f17 Abbreviate commit SHA1s for :Grebase -i
Rather than generating the full 40 character SHA1, this commit changes
the rebase todo file to use the abbreviated kind.
2019-06-02 12:59:47 -04:00
Tim Pope
0f9db6af70 Fix garbled screen after :Git! and related commands
Closes https://github.com/tpope/vim-fugitive/issues/1258
2019-05-21 17:00:12 -04:00
Tim Pope
5d99841b22 Fix fugitive#glob('[^x]') 2019-05-04 18:54:16 -04:00
Tim Pope
2bde1d9de6 Don't activate autocmds with tmp filenames
This was done in d4fb2a2f5c to fix
filetype modelines, but it appears to no longer be necessary and is
confusing other plugins.
2019-05-02 23:44:16 -04:00
Tim Pope
b27e71c34b Add <nowait> to gq map 2019-05-02 23:44:16 -04:00
Tim Pope
cfbaa27d11 Fix :Gstatus log with unpushed remote 2019-05-02 23:44:16 -04:00
Teo Ljungberg
16b7a060a3 Pass in matching number of arguments for :Gread
This was changed in 1ac2c70 for the other git commands, leading to the
following error message:

```
E118: Too many arguments for function: s:ReadCommand
```
2019-04-24 13:18:19 -04:00
Tim Pope
1ac2c707e5 Begin moving to standard command implementation interface
This is just the low hanging fruit.  The goal is to make these adhere to
account for all possible future parameters so that these functions can
(maybe) be made public.
2019-04-05 21:47:09 -04:00
Tim Pope
4ec81b5251 New naming scheme for completion functions 2019-04-05 21:47:09 -04:00
Tim Pope
60eac8c974 Call :Gcommit from :Grebase --continue 2019-04-05 21:47:09 -04:00
Jay Sitter
1b3668b89f Allow --abbrev as :Gblame argument (#1243) 2019-04-04 14:28:14 -04:00
Tim Pope
3aaeaca87b Fix restore of sequence editor 2019-04-04 13:59:42 -04:00
Tim Pope
59f104075c Revert "Add documentation for --relative-date in :Gblame"
This option doesn't work very well.

This reverts commit 86d6872ce2.
2019-04-04 13:59:42 -04:00
Jay Sitter
86d6872ce2 Add documentation for --relative-date in :Gblame 2019-04-04 13:48:33 -04:00
Tim Pope
bd0b87d36a Provide gq to close status buffer
References https://github.com/tpope/vim-fugitive/issues/1221
2019-03-01 16:43:42 -05:00
Tim Pope
57b4d848a4 Use :setlocal for all local options 2019-02-28 20:08:59 -05:00
Tim Pope
94723902fb Remove stopgap support for reload after :Dispatch
ShellCmdPost is now supported in dispatch.vim.
2019-02-28 20:08:59 -05:00
Maksim Odnoletkov
ddd0513071 Reblame at HEAD from dirty lines
HEAD blame seems to be much more useful than index blame. You can
continue following evolution of the line with further jumps while before
you got struck on 'not yet committed' line if it was already added to
the index.
2019-02-27 23:59:39 -05:00
Tim Pope
b44b7b8ae7 Encapsulate b:git_dir 2019-02-27 23:42:58 -05:00
Tim Pope
0171b2a5b0 Fix function name mutilated by search and replace 2019-02-27 23:42:58 -05:00
Tim Pope
666c4abc12 Brute force mapping jumps
This is supposed to happen on FileType git, but depending on autocommand
order, exists('b:git_dir') might erroneously fail.
2019-02-27 23:42:58 -05:00
Tim Pope
a69b0b0fd6 Fix unofficial "a" map
Closes https://github.com/tpope/vim-fugitive/issues/1218
2019-02-25 14:18:36 -05:00
Tim Pope
66073d955d Use blamed file when calling :Gbrowse in blame buffer 2019-02-25 14:18:36 -05:00
bennyyip
1a3c04585b Gblame: allow passing --relative-date 2019-02-23 19:38:43 -05:00
Tim Pope
ad32eae7e2 Override color.ui=always
Closes https://github.com/tpope/vim-fugitive/issues/1217
2019-02-23 18:11:31 -05:00
Tim Pope
c5d8b25c5e Don't repeatedly trigger FocusGained on win32
References https://github.com/tpope/vim-fugitive/issues/1209
2019-02-23 15:21:30 -05:00
Tim Pope
f259fd5d6d Provide "i"
This is a weird one, and might get axed.
2019-02-21 13:28:10 -05:00
Tim Pope
755554bb3c Sort untracked files before unstaged files 2019-02-21 13:28:10 -05:00
Tim Pope
28a03d0b00 Provide option for status reloading
Closes https://github.com/tpope/vim-fugitive/issues/1209
2019-02-21 13:28:10 -05:00
Tim Pope
8caa4a0ba3 Try J/K for next/previous
I'm also entertaining using J to toggle the "squash" instruction in an
interactive rebase, so no documentation for these yet.
2019-02-21 12:39:16 -05:00
Tim Pope
01b9a645b6 Provide checkout --ours/--theirs on X
Closes https://github.com/tpope/vim-fugitive/issues/954
2019-02-20 23:49:41 -05:00
Tim Pope
74aefa53ac Support X on newly added file
Closes https://github.com/tpope/vim-fugitive/issues/1212
2019-02-20 23:49:41 -05:00
Tim Pope
654f7f5432 Support "." in visual mode 2019-02-20 23:41:32 -05:00
Tim Pope
26cf153e76 Refactor status spaghetti into dispatch mechanism 2019-02-18 17:26:39 -05:00
Tim Pope
15fb5f68ad Remove duplicate q map 2019-02-18 14:02:33 -05:00
Tim Pope
a489c6e1d3 Fix reveal of hunks on CTRL-N 2019-02-13 21:01:19 -05:00
Tim Pope
02c26619c4 Remove duplicate help tag
These should be unified, but for now, --patch is just stealing the
spotlight from inline diffs, so I won't shed any tears over dropping its
help tag.

Closes https://github.com/tpope/vim-fugitive/issues/1203
2019-02-12 15:58:53 -05:00
Tim Pope
e9705826bd Trailing whitespace 2019-02-12 11:19:18 -05:00
Tim Pope
8c33bdfc26 Update :Gstatus description in README
This still doesn't do it justice, but it's a step in the right
direction.
2019-02-12 11:06:12 -05:00
Tim Pope
b3de2f2284 Handle mysterious tab at the end of a diff filename with spaces
Closes https://github.com/tpope/vim-fugitive/issues/1202
2019-02-12 10:39:24 -05:00
Tim Pope
5c5581386f Redo :Gstatus documentation 2019-02-11 13:22:47 -05:00
Tim Pope
817fc15287 Remove comment 2019-02-11 09:06:14 -05:00
Brennen Bearnes
ce8ddf37fc Fix autocmds & alternate file handling for "index"
This commit tweaks the existing autocommand for files matching
`index{,.lock}` to:

  - Fire BufReadPre and BufReadPost on either side of the read
    operation for files not in a `.git/` and already extant.
  - Fire BufNewFile for new files not in a `.git`.
  - Add `keepalt` to the `read`, thus allowing alternative file
    operations such as Ctrl-^ to work correctly.

Has been tested against:

  - BufReadPost,BufNewFile autocommands
  - A basic test case for alternate files where one is named `index`

Closes https://github.com/tpope/vim-fugitive/issues/834

Closes https://github.com/tpope/vim-fugitive/issues/959
2019-02-11 09:05:36 -05:00
Tim Pope
7cb2ca81e3 Use current window for :0Gsplit
This is to enable :0Gsplit! to replace :Git!, opening that command up
for something more useful.
2019-02-10 18:49:04 -05:00
Tim Pope
0727261b38 Fix current line assumption 2019-02-10 18:49:04 -05:00
Tim Pope
489201879b Eliminate s:StageReloadSeek() 2019-02-10 18:49:04 -05:00
Tim Pope
8899468c09 Handle git --version with (Apple ...) suffix
References https://github.com/tpope/vim-fugitive/issues/1194
2019-02-06 15:54:00 -05:00
Tim Pope
ed07f9a503 Guard against status reloading in wrong buffer
Closes https://github.com/tpope/vim-fugitive/issues/1191
2019-02-03 01:58:29 -05:00
Henrique Malheiro
c98d3cf38f Fix bug in excluding Gstatus window from reuse
When Gstatus is the only window, executing Gdiff results in the Gstatus
being reused for the diff split.

Closes https://github.com/tpope/vim-fugitive/issues/853
2019-02-02 13:02:41 -05:00
David Briscoe
3304c14c63 Move filetype to after maps to allow user maps
The easiest way for users to define their own maps in Gstatus buffers is
using a ftplugin/fugitive.vim file with a `b:fugitive_type != 'index'`
guard. Setting the filetype after defining the maps allows users to
maniuplate "dangerous" maps and otherwise customize mappings.

For example, in ~/.vim/after/ftplugin/fugitive.vim:

    if !exists('g:loaded_fugitive') || b:fugitive_type != 'index'
        finish
    endif

    " Use s to stage *and* unstage changes: shadows -.
    nmap <buffer> <silent> s -
    xmap <buffer> <silent> s -

    " I hit this by accident.
    nunmap <buffer> X
2019-01-31 01:43:18 -05:00
Tim Pope
d27dbc40d4 Respect 'splitbelow' in :Gstatus
References https://github.com/tpope/vim-fugitive/issues/1169
2019-01-27 07:53:13 -05:00
John Drouhard
50cf1b3bd1 Fix s:Cd() usage in the Gblame command
Most usages in commit da3b2f32 (Support tab local working directories)
were updated to use this pattern, but Gblame missed the boat. Without
this, Gblame will change the root git tree but won't change back to the
previous location.
2019-01-27 05:26:00 -05:00
Tim Pope
8b32524219 Don't force foldtext for status buffer
Closes https://github.com/tpope/vim-fugitive/issues/1183
2019-01-26 03:55:33 -05:00
Tim Pope
5a7f5967e7 Don't set readonly globally 2019-01-24 14:11:07 -05:00
Tim Pope
552baf98b3 Support git grep --column
Closes
https://github.com/tpope/vim-fugitive/issues/1168
2019-01-13 15:17:09 -05:00
Tim Pope
58a4a2e102 Provide Git version comparison API 2019-01-13 15:17:09 -05:00
Maksim Odnoletkov
8bf74ceef3 Make all maps reblame at index when on dirty lines
Otherwise parent and grandparent maps lead to invalid URLs
2019-01-11 23:00:29 -05:00
Tim Pope
fe467f78bc Allow ShellCmdPost to fire inside :Make
This was trying to block `au QuickFixCmdPost * copen` as it interfered
with restoring the working directory, but that was mainly a concern for
the other half of the conditional, so restore it to enable the status
buffer to reload.
2019-01-11 14:11:25 -05:00
Tim Pope
07845537d7 Fix :belowright Gstatus
Closes https://github.com/tpope/vim-fugitive/issues/1169
2019-01-11 13:58:40 -05:00
Tim Pope
ddc5e1a21a Reload status after :Gpush and :Gfetch
So :make does indeed invoke ShellCmdPost.  I just forgot about the
:noautocmd.

Closes https://github.com/tpope/vim-fugitive/issues/1166
2019-01-09 20:00:35 -05:00
Tim Pope
9211b11cd2 Use native edit commands in :Gstatus
This lets the :topleft modification kick in on older versions of Vim.
2019-01-09 15:00:36 -05:00
Tim Pope
6e74463965 Run :Gstatus edit command at top level
This results in a cleaner error when calling :edit in a modified file.
2019-01-09 14:57:07 -05:00
Tim Pope
b8a6fd204c Always default to horizontal split for :Gstatus
Closes https://github.com/tpope/vim-fugitive/issues/1163
2019-01-09 14:03:43 -05:00
Tim Pope
75ca90739b Ignore warnings in git status --porcelain 2019-01-09 14:03:43 -05:00
Tim Pope
5a1c8bbe46 Reload status on all quickfix commands
I thought that I had confirmed :make triggered ShellCmdPost but
apparently not.

Closes https://github.com/tpope/vim-fugitive/issues/1166
2019-01-09 14:03:43 -05:00
Tim Pope
bb46630828 Clarify that removal notices need to be fixed at the source 2019-01-07 11:30:04 -05:00
Tim Pope
c448104332 Fix :Gread deleting too much due to closed folds 2019-01-07 10:23:17 -05:00
Tim Pope
441074f881 Fix unstaging a deleted file
Apparently the -- is mandatory if the file no longer exists.

Closes https://github.com/tpope/vim-fugitive/issues/1161
2019-01-07 10:23:17 -05:00
Tim Pope
68cd7ecf71 Add simple rebase maps
Leaving undocumented until the rebase functionality is more fleshed out.
2019-01-06 01:58:15 -05:00
Tim Pope
fbeb9d6793 Use appropriate message for :Glog --walk-reflogs 2019-01-06 01:58:15 -05:00
Tim Pope
07f4f8d2a9 Don't set global value of 'modifiable' 2019-01-06 01:58:15 -05:00
Tim Pope
29f16cd924 Deprecate :Glog defaulting to current file 2019-01-05 14:08:01 -05:00
Tim Pope
b9ea3efdf8 Fix navigation maps like ~ in commit 2019-01-05 01:57:13 -05:00
Tim Pope
b1a993964b Fix commit maps while accommodating bad modelines
We need modifiable off for the maps to kick in, but we need to turn it
back off before the doautocmd or else it will throw an error if the
modeline modifies the buffer with an option like fileencoding, which you
should never do, stop doing it.
2019-01-05 01:44:04 -05:00
Tim Pope
b88d064ac4 Nobody has a version of Vim older than 7.2 anymore 2019-01-05 01:36:40 -05:00
Tim Pope
201896b9a2 Clarify - map 2019-01-05 01:33:17 -05:00
Tim Pope
acf3cb4400 Reveal full hunk on :Gstatus CTRL-N 2019-01-03 22:47:41 -05:00
Tim Pope
9c74c0d0a7 Restore :checktime for :Gstatus delete
I assumed this was a naive attempt to reload the status buffer, when in
fact it was concerned with reloading the deleted file.
2019-01-03 22:47:41 -05:00
Tim Pope
4df6525284 Fix check for :Gstatus window 2019-01-03 22:47:41 -05:00
Tim Pope
a4de0238bb Try split instead of preview window for :G 2019-01-03 21:08:27 -05:00
Tim Pope
227159e964 Include backslash lines in diff hunks 2019-01-03 21:08:27 -05:00
Tim Pope
9e4fd4b3f6 Run diff for :Gstatus from project root
Closes https://github.com/tpope/vim-fugitive/issues/1155
2019-01-03 21:08:27 -05:00
Tim Pope
8c89c8d1f5 Enable maps in :Git! output buffers 2019-01-03 16:08:01 -05:00
Tim Pope
42408d6a2e Don't break jump list when loading buffer
Closes https://github.com/tpope/vim-fugitive/issues/1124
2019-01-03 16:08:01 -05:00
Tim Pope
3383badda5 Don't stage/unstage from unstage/stage maps
This needs count and visual selection support.
2019-01-03 12:20:54 -05:00
Tim Pope
faeb3a9726 Enable discarding individual hunks 2019-01-03 11:44:19 -05:00
Tim Pope
357fbdbcf9 Enable staging individual hunks 2019-01-03 11:44:19 -05:00
Tim Pope
6cf448324c Fix inline diffs including submodule logs
Closes https://github.com/tpope/vim-fugitive/issues/1151
2019-01-03 11:44:19 -05:00
Andrew Haust
fa6d7886e7 Fix patch mapping in README 2019-01-03 11:02:10 -05:00
Tim Pope
d948ec3376 Support expanding inline diffs in :Gstatus 2019-01-03 00:19:21 -05:00
Tim Pope
51abc6a1bb Fix :Gstatus toggle on Unstaged heading 2019-01-02 16:58:50 -05:00
Tim Pope
d4e06150cb Fix issue loading conflict buffers on :Grebase -i 2019-01-02 16:58:50 -05:00
Tim Pope
61d467b573 Extract function for reloading individual :Gstatus 2019-01-02 16:58:50 -05:00
Tim Pope
054ac50975 Fix reference to rebase buffer when closing tab 2019-01-01 19:28:01 -05:00
Tim Pope
037965583e Don't overlap navigation maps with :Gcommit maps 2019-01-01 19:01:33 -05:00
Tim Pope
4c7998f58c Add :G as alias for :Gstatus 2019-01-01 14:21:16 -05:00
Tim Pope
40e8d0b9f0 Support for :Grebase --interactive 2018-12-31 13:48:38 -05:00
Tim Pope
9aef731593 Add rebase summary to :Gstatus
For lack of better ideas this is heavily inspired by Magit, though I'm
not really convinced it's the best representation.
2018-12-31 12:08:31 -05:00
Tim Pope
bad1331607 Don't jump from :Gstatus another :Gstatus 2018-12-31 12:07:45 -05:00
Tim Pope
ce3d3df508 Fix maps in commit buffers 2018-12-31 01:45:12 -05:00
Tim Pope
cb18a96651 Do what I mean for :Grebase --autosquash 2018-12-31 01:01:07 -05:00
Tim Pope
b8364709e7 Refer :Gstatus p users to P 2018-12-31 01:01:07 -05:00
Tim Pope
b9825af3dc Fix focus bug on reloading multiple :Gstatus buffers 2018-12-31 01:01:07 -05:00
Tim Pope
08179e1860 Declare highlights as defaults 2018-12-30 22:19:33 -05:00
Tim Pope
682b2acdac Remove outdated reference to :Gcommit calling :Gstatus
Closes https://github.com/tpope/vim-fugitive/issues/1144
2018-12-29 12:40:06 -05:00
Tim Pope
d41dee9c0b Deprecate fugitive#buffer() 2018-12-28 17:54:57 -05:00
rbong
b66141e252 Open todo file on Grebase --edit-todo 2018-12-28 17:53:01 -05:00
rbong
ae8fed6dd3 Call Gcommit on Grebase --continue
On a rebase instruction that should result in an immediate commit,
the quickfix list will be closed and Gcommit will be called.
2018-12-28 17:53:01 -05:00
Tim Pope
0850600021 Combine unstaged and untracked files into one section
Is this a good idea?  Let's find out!
2018-12-27 18:05:29 -05:00
Tim Pope
86990ef899 Fix - on :Gstatus section headings 2018-12-27 17:34:51 -05:00
Tim Pope
f2b644a60b Set dispatch to :Gfetch in :Gstatus 2018-12-26 16:24:16 -05:00
Tim Pope
a1f9596d2d Add mods support to :Gmerge 2018-12-26 16:24:16 -05:00
Tim Pope
de1f8b5a20 Fix workaround to reload status after :Dispatch 2018-12-26 16:24:16 -05:00
Tim Pope
a32c301f51 Remove :Gcommit claiming :Gstatus window 2018-12-25 19:36:26 -05:00
Tim Pope
261c00986d Change vsplit map from S to gO 2018-12-25 19:35:13 -05:00
Tim Pope
01050c9569 Fix :Gstatus error on branch without pull source 2018-12-25 16:35:00 -05:00
Tim Pope
d3468dd09b Prototype new :Gstatus 2018-12-25 14:11:50 -05:00
Tim Pope
d06080ae35 Reload status after dispatch.vim backed :Gpush 2018-12-24 17:25:32 -05:00
Tim Pope
1044e0f126 Fix config case sensitivity when cached 2018-12-24 17:25:29 -05:00
Tim Pope
d4eba85499 Add maps for :Gcommit --fixup/--squash 2018-12-24 14:42:47 -05:00
Tim Pope
b295f49e93 Change :Gstatus U to g|
I want U for a full `git reset`.  This will probably end up on X, but I
don't want to do a second abrupt transition, so for now, the official
map is the ungainly g|.
2018-12-24 14:42:47 -05:00
Tim Pope
d625c55689 Fix erratic conf file type on :Gstatus
Closes https://github.com/tpope/vim-fugitive/issues/1137
2018-12-24 11:36:39 -05:00
Tim Pope
baee3bbfe8 Prevent bad modeline from blocking a :split
Closes https://github.com/tpope/vim-fugitive/issues/1136
2018-12-23 17:15:44 -05:00
Tim Pope
38c6acf27a Disable modelines while loading blob
Modelines will still be evaluated by `doautocmd BufReadPost`.

References https://github.com/tpope/vim-fugitive/issues/1136
2018-12-23 14:31:16 -05:00
Zhao Xiaojie
70170d825c Add Gitee link (#1099) 2018-12-22 15:25:41 -05:00
Tim Pope
0f6038881f Handle case sensitivity in config keys correctly 2018-12-22 14:59:59 -05:00
Tim Pope
4ecd7e8932 Allow reusing dictionary for config queries 2018-12-22 14:59:59 -05:00
Tim Pope
73220820b5 Don't open :Gstatus on empty :Gcommit 2018-12-19 17:25:05 -05:00
Tim Pope
5540d257ef Add s and u aliases for stage/unstage in :Gstatus 2018-12-19 17:25:05 -05:00
Tim Pope
d48fc4a5ec Cache config queries
Does not support includeIf directives or a system config outside of
/etc/gitconfig for cache expiration.
2018-12-19 17:25:05 -05:00
Tim Pope
c98daaacfe Refactor :Gstatus reload cursor positioning 2018-12-18 19:53:24 -05:00
Tim Pope
e8f4f28c93 Replace deprecated repository relative path syntax 2018-12-18 18:44:49 -05:00
Tim Pope
da3b2f3285 Support tab local working directories 2018-12-16 22:28:01 -05:00
Tim Pope
2564c37d0a fugitive.vim 2.5
* Support :source and :write on Fugitive URLs.
* Support :Gedit +cmd ++opt.
* Support :Gedit /absolute/path and ./relative/path.
* Support expansion flags, like :Gedit %:h.
* Support completion of commits for --fixup=/--squash=.
* Support :Gread commit to read commit message.
* Adjust :Gbrowse line range for upstream head.
* Map <CR> in blobs to jump to blamed commit.
* Map p to jump to file in preview window.
* Make :Gmove always relative to repository root.
* Load Projectionist config from .git/info/projections.json.
* Drop instaweb support.
* New public function API.
* Major robustness and error handling improvements.
* Bug fixes.
2018-11-22 09:48:10 -05:00
Tim Pope
c316b924e8 Provide FugitivePrepare() 2018-11-22 09:36:28 -05:00
Tim Pope
7a190ead85 Remove transitional functions 2018-11-19 23:01:28 -05:00
Daniel Hahler
e48cf2dadd Gblame: allow passing --first-parent
Also fixes the filter for `--root` and `--show-name`.
2018-11-18 17:11:26 -05:00
Tim Pope
6d497b0e63 Fix erroneous use of :keeppatterns g/.../s//.../
Closes https://github.com/tpope/vim-fugitive/issues/1008
2018-10-28 19:48:15 -04:00
Tim Pope
dcf32d2b3d Clearer errors 2018-10-27 18:22:15 -04:00
Tim Pope
0fd64f8fbf Remove FugitiveGenerate() in favor of FugitiveFind() 2018-10-21 19:44:20 -04:00
Tim Pope
2845e6dc4f Fail silently retrieving work tree for blank git dir
Closes https://github.com/tpope/vim-fugitive/issues/1113
2018-10-17 23:20:11 -04:00
Tim Pope
7fae98f263 Associate conflicted files with relevant commits 2018-10-12 15:14:49 -04:00
Tim Pope
a9100fafb8 Show 7 not 8 SHA charcters in statusline 2018-09-24 17:04:06 -04:00
Tim Pope
9fec8aadc5 Use merge-base as starting point for ranged :Gbrowse 2018-09-19 17:38:19 -04:00
Tim Pope
66697b99d6 Don't throw error on invalid URL to FugitiveParse() 2018-09-19 17:17:17 -04:00
Tim Pope
fb55319973 Show error getting type for object in BufReadCmd 2018-09-15 16:47:28 -04:00
Justin M. Keyes
02fe20ece4 Use :keeppatterns with :substitute 2018-09-15 12:26:10 -04:00
Rick
6cd8ff77f0 Fix undefined variable 2018-09-13 10:51:08 -04:00
Tim Pope
af76267c6a Fix backport of @ to old Git 2018-09-12 12:32:43 -04:00
Tim Pope
144b73946e Older versions of cat-file do not accept -- 2018-09-12 12:06:19 -04:00
Tim Pope
d4fb2a2f5c Fix modeline support in historical buffers
Closes https://github.com/tpope/vim-fugitive/issues/1092
2018-09-09 09:37:06 -04:00
Tim Pope
4bf30ce907 Dogfood fugitive#Prepare() 2018-09-02 23:26:14 -04:00
Tim Pope
0fe0964385 Enhance fugitive#Prepare() 2018-09-02 23:25:43 -04:00
Tim Pope
8b4a1017b6 Simplify :Gstatus reset logic 2018-08-29 20:35:35 -04:00
Tim Pope
66e0fe5d3e Fix - in :Gstatus on line 1 as Vinegar like navigation 2018-08-29 20:34:42 -04:00
Tim Pope
61b09ca6b7 Fix gf in gitcommit diff
Closes https://github.com/tpope/vim-fugitive/issues/1084
2018-08-29 17:15:28 -04:00
Tim Pope
b3651aa744 Use platform path separator for Projectionist config 2018-08-29 17:15:28 -04:00
Tim Pope
fd83fcaf90 Support expansion flags 2018-08-28 00:35:35 -04:00
Tim Pope
1e3786734b Add potential alternative name for FugitiveRoute() 2018-08-28 00:35:35 -04:00
Tim Pope
4d3835f637 Accept buffer number to FugitiveRoute() 2018-08-28 00:35:35 -04:00
Tim Pope
44e5df8433 Provide API for retrieving working dir relative path 2018-08-27 21:04:41 -04:00
Tim Pope
a202238b5d Support Projectionist config in .git/info/projections.json 2018-08-26 17:42:19 -04:00
Tim Pope
bb2797d313 Special case :0Gread to get around FileReadCmd limitations 2018-08-20 15:00:55 -04:00
Tim Pope
67e9756c35 Support .git/.. to refer to work tree 2018-08-20 15:00:55 -04:00
Tim Pope
ae2005adbb Return '' for FugitiveRoute('') 2018-08-20 15:00:55 -04:00
Tim Pope
ed36717a68 Use 2 argument system() rather than stdin redirect 2018-08-19 23:26:36 -04:00
Tim Pope
b1ab990314 Use -- to disambiguate arguments
This is to enable future replacement of s:Prepare() with
fugitive#Prepare().
2018-08-19 23:24:45 -04:00
Tim Pope
2b5effe2f1 Fix :Gbrowse with cwd other than work tree 2018-08-19 18:27:46 -04:00
Tim Pope
662b501eee Resolve temp files only when using as buffer name
Closes https://github.com/tpope/vim-fugitive/issues/1078
2018-08-19 14:56:34 -04:00
Tim Pope
7bdf33d375 Always convert backslashes on Windows
The old conditional was fine for most things, but this ensures that
backslashes are used even for raw user input.

References https://github.com/tpope/vim-fugitive/issues/1079
2018-08-19 14:56:34 -04:00
Tim Pope
e9dc363745 Fix check for need to convert Windows path slashes
Closes https://github.com/tpope/vim-fugitive/issues/1079
2018-08-19 05:07:33 -04:00
Tim Pope
9979b2ab7c Ignore 'shellslash' when checking for Win32 shell 2018-08-19 00:11:46 -04:00
Tim Pope
8589246545 Tweak check for Win32 shell
References https://github.com/tpope/vim-fugitive/issues/1079
2018-08-18 23:15:05 -04:00
Tim Pope
7b0aa58090 Accept ./ paths as relative to cwd 2018-08-15 19:24:35 -04:00
Tim Pope
45c21fc384 Normalize path specs when generating commands 2018-08-13 00:08:59 -04:00
Tim Pope
8dc13a6a72 Restore backwards compatible behavior of repo.translate() 2018-08-12 23:03:20 -04:00
Tim Pope
0614acc770 Fix issues with commit:./relative completion 2018-08-12 21:37:38 -04:00
Tim Pope
1a7b07cf22 Support commit:./relative style revisions 2018-08-11 19:15:56 -04:00
Tim Pope
4a3c6b4a56 Adjust section headers 2018-08-11 19:15:56 -04:00
Tim Pope
e3c9588e07 Extract function for getting current commit/ref 2018-08-11 19:15:56 -04:00
Tim Pope
40facfde5e Rewrite <C-R><C-G> and y<C-G> 2018-08-11 02:41:33 -04:00
Tim Pope
236bd21b45 Use <nowait> for - maps
Closes https://github.com/tpope/vim-fugitive/issues/1076
2018-08-11 02:41:33 -04:00
Tim Pope
e9ce313912 Support pathspec arguments to :Gcd 2018-08-11 01:26:23 -04:00
Tim Pope
74b10425eb Fix legacy expansion of bare caret/tilde 2018-08-11 01:26:21 -04:00
Tim Pope
1a041936da Provide less awkward signature for s:Prepare() 2018-08-11 00:55:21 -04:00
Tim Pope
a358191cfb Use unambiguous paths for :Gstatus dot map
When the current working directory isn't the work tree, use absolute
paths so that pairing with both :Git and :! works as expected.
2018-08-10 19:22:13 -04:00
Tim Pope
597289e64d Handle :Gmove paths consistently 2018-08-10 19:22:13 -04:00
Tim Pope
7ea21ca9ac Give precedence to absolute paths over pseudo-relative
I was planning on phasing out support for /path to access a file in the
root of the repo slowly, but life gets simpler if we can count on
absolute paths always working as expected.
2018-08-10 16:00:46 -04:00
Tim Pope
2ca0765dc4 Ignore dot files when globbing 2018-08-10 16:00:46 -04:00
Tim Pope
347d309efb Mention :Gcommit %
Closes https://github.com/tpope/vim-fugitive/issues/1029
2018-08-10 16:00:42 -04:00
John Varga
6138aebbbb Fix minor spelling error in help document 2018-08-08 16:26:11 -04:00
Tim Pope
dd262b7e21 Decouple routing from repo object 2018-08-06 16:38:49 -04:00
Tim Pope
f91c34069e Decouple Head() from repo object 2018-08-06 16:38:49 -04:00
Tim Pope
40e2dcba05 Delegate to other real filename implementations 2018-08-06 16:38:49 -04:00
Tim Pope
a3e9518186 Fix file API to distinguish between commits 2018-08-06 16:38:49 -04:00
Tim Pope
8c63314381 Report error checking for merge conflict
References https://github.com/tpope/vim-fugitive/issues/756
2018-08-06 11:13:42 -04:00
Tim Pope
12e0151750 Adjust completion of /absolute/paths
Support for an initial slash to access a work tree file is being phased
out.
2018-08-06 10:55:46 -04:00
Tim Pope
887d86e920 Don't strip trailing slash from URLs 2018-08-06 10:54:09 -04:00
Tim Pope
73ed8e8a71 Fix check for empty remote 2018-08-06 01:45:39 -04:00
Tim Pope
4bf7f2fd69 Support :(top) pseudo-pathspecs 2018-08-04 20:13:47 -04:00
Tim Pope
08d471056e Provide fugitive#Prepare() 2018-08-04 20:13:47 -04:00
Tim Pope
969a3d857f Don't escape "!" when calling :terminal 2018-08-04 20:13:47 -04:00
Tim Pope
06b3da7204 Fix shell expansion in :Git! buffers 2018-08-04 18:54:28 -04:00
Tim Pope
db3b837e6e Rewrite :Glog to use string argument rather than list
This makes shell expansion less weird.
2018-08-03 01:35:44 -04:00
Tim Pope
b780bce39b Expand argument to :Gwrite 2018-08-02 22:50:33 -04:00
Tim Pope
a615172b14 Edit index file when no work tree present
Life gets simpler if this function never fails.
2018-08-02 18:39:02 -04:00
Tim Pope
caee67c748 Fix query operations in bare repositories 2018-08-02 18:39:02 -04:00
Tim Pope
1fea1e5821 Support :Gedit /absolute/path when possible
Usage of /relative/path is deprecated in favor of ./relative/path, but
it's still supported on top of this for now.
2018-08-02 15:32:14 -04:00
Tim Pope
80e410c81a Fix :Gedit default from commit to work tree 2018-08-02 15:16:36 -04:00
Tim Pope
84fcfae7f0 Unify shell expansion 2018-08-01 21:49:49 -04:00
Tim Pope
4d684256ba Update :Gbrowse docs 2018-08-01 17:21:16 -04:00
Tim Pope
0e948d514c Fix write command with Win32 path 2018-08-01 14:14:38 -04:00
Tim Pope
4eee908ad5 Adjust :Gbrowse range for upstream head 2018-08-01 13:54:12 -04:00
Tim Pope
c1d2fc1a19 Remove filename expansion from buffer object
This has long haunted me as a particularly egregious design, as
expansion of "%" is always respective to the current buffer.
2018-07-31 23:57:38 -04:00
Tim Pope
c85980cd93 Rename s:shellslash() to s:Slash() 2018-07-31 16:39:15 -04:00
Tim Pope
81deb6333a Improve worktree support 2018-07-31 16:39:13 -04:00
Tim Pope
85f340590d Fix :Gbrowse in historical buffers 2018-07-31 15:25:14 -04:00
Tim Pope
fc8f9eda9d Rename Fugitive revisions to Fugitive objects
Neither term is great, as they both exclude work tree files in Git
parlance, but "object" is a better umbrella term as "revision" can be
actively misleading in some contexts.
2018-07-31 02:44:44 -04:00
Tim Pope
c82abd0558 Fix function reference 2018-07-31 02:44:42 -04:00
Tim Pope
d859e05f00 Really fix :Gcd
Closes https://github.com/tpope/vim-fugitive/issues/1071
2018-07-31 02:24:31 -04:00
Tim Pope
3feda7f440 Fix :Gcd
Closes https://github.com/tpope/vim-fugitive/issues/1071
2018-07-31 01:00:14 -04:00
Tim Pope
c9c406a118 Fix extra slash generating work tree filenames
Closes https://github.com/tpope/vim-fugitive/issues/1069
2018-07-30 19:40:47 -04:00
Tim Pope
a877908acd Fix check for absolute path in FugitiveGenerate() 2018-07-30 01:36:31 -04:00
Tim Pope
6c89a3675b Support :Gedit +cmd ++opt 2018-07-30 00:47:26 -04:00
Tim Pope
bf796562b6 Add better name for function as alias 2018-07-29 22:41:29 -04:00
Tim Pope
023ab8e4a6 Eliminate s:repo() and s:buffer() 2018-07-29 22:41:29 -04:00
Tim Pope
da95d96ece Replace s:repo().rev_parse() 2018-07-29 22:41:29 -04:00
Tim Pope
8a0a448f56 Show fake trees when editing directory in index 2018-07-29 15:08:31 -04:00
Tim Pope
004da420e5 Match trailing slash in FugitivePath() 2018-07-29 14:30:51 -04:00
Tim Pope
8b4194047c Rearrange 2018-07-29 14:30:48 -04:00
Tim Pope
716edd4bc0 Redo completion 2018-07-29 00:24:28 -04:00
Tim Pope
70c0f132f5 Fix :Gblame 2018-07-29 00:24:28 -04:00
Tim Pope
a8392e0ebb Fix fugitive#Real() with non-Fugitive URL 2018-07-29 00:24:28 -04:00
Tim Pope
64fbfc7a8d Whitespace fix 2018-07-29 00:24:28 -04:00
Tim Pope
f232e4c6a3 Support completion of local commits for --fixup=/--squash= 2018-07-28 22:05:03 -04:00
Tim Pope
db7fd110a8 Move implementation functions below public API 2018-07-28 22:05:03 -04:00
Tim Pope
248764f2c3 Provide FugitiveGitDir() 2018-07-28 22:05:03 -04:00
Tim Pope
f8fb5eafab Eliminate remaining s:repo().dir() and s:repo().tree() calls 2018-07-28 22:05:03 -04:00
Tim Pope
4f82d241cc Fix jump to file 2018-07-28 22:05:03 -04:00
Tim Pope
f761ea700c Rewrite :Gedit and :Gread 2018-07-28 20:33:28 -04:00
Tim Pope
035cdf44e8 Make fugitive#Prepare() private 2018-07-28 20:33:17 -04:00
Tim Pope
deaf4aa139 Pass absolute paths through FugitiveGenerate() unchanged
This is designed to exclude traditional paths, URLs, and also Vim
constructs like zipfile:c:\foo.zip::file.
2018-07-28 20:33:17 -04:00
Tim Pope
da066426fd Use <amatch> in detection autocommands 2018-07-28 19:43:44 -04:00
Tim Pope
4643363b08 Handle FugitiveReal('') correctly 2018-07-28 19:43:44 -04:00
Tim Pope
c5d4ce7479 Fix map to follow the pattern 2018-07-28 17:37:07 -04:00
Ryo Susami
6eadff1107 Correct the directory separator of Path() on Windows (#1067) 2018-07-28 01:50:51 -04:00
Tim Pope
c68fb3c83a Remove redundant maps 2018-07-27 13:42:11 -04:00
Tim Pope
6c09ce3ab4 Prefer :Gedit to s:Edit() where possible 2018-07-27 13:39:53 -04:00
Tim Pope
cec05fac01 Fix missing :Gblame in work tree files
Closes https://github.com/tpope/vim-fugitive/issues/1066
2018-07-27 08:54:58 -04:00
Tim Pope
4b0475f9d8 Map <CR> in blobs to jump to blamed commit 2018-07-27 01:48:44 -04:00
Tim Pope
8edc9cd006 Work around janky autocommands when returning to diffed window
Closes https://github.com/tpope/vim-fugitive/issues/1065
2018-07-27 01:46:13 -04:00
Tim Pope
382c0a5405 Provide config functions globally
This makes it easier to check for them with exists().
2018-07-27 01:46:13 -04:00
Tim Pope
c472b8f2c1 Provide file permission API 2018-07-27 01:34:49 -04:00
Tim Pope
30c2490b6e Provide file writing API 2018-07-27 01:34:49 -04:00
Tim Pope
5a9b7a593b Provide file deletion API 2018-07-27 01:34:49 -04:00
Tim Pope
4ce8646410 Remove s:repo().aliases() 2018-07-27 01:34:49 -04:00
Tim Pope
321f63ff19 Compartmentalize filetype support 2018-07-27 00:19:57 -04:00
Tim Pope
7f299fbbe3 Eliminate remaining uses of s:buffer().type() 2018-07-27 00:19:57 -04:00
Tim Pope
6d0df81732 Run correct auto-commands for BufWrite and FileWrite 2018-07-26 20:56:26 -04:00
Tim Pope
5cea916e9c Support Vim without SourceCmd 2018-07-26 20:54:39 -04:00
Tim Pope
c3c39d904b Try embedding shell cd if -C not available
Old Git versions lacking -C are often paired with old Vim versions
lacking haslocaldir(), so chance some shell weirdness over screwing up
Vim's local directory.
2018-07-26 15:51:06 -04:00
Tim Pope
6bab1a0c39 Map p to jump to file in preview window
Closes https://github.com/tpope/vim-fugitive/issues/1047
2018-07-25 16:30:54 -04:00
Tim Pope
49c2a4acb5 Revert "Unify jump to file logic"
This reverts commit 73c39195ae, which
broke opening in a different window from :Gstatus.
2018-07-25 16:12:19 -04:00
Tim Pope
73c39195ae Unify jump to file logic 2018-07-25 02:04:48 -04:00
Tim Pope
f818a947ae Map p to in :Gblame to open commit in preview window 2018-07-25 01:06:08 -04:00
Tim Pope
fbaa831e57 Show error on :Gblame jump on uncommitted line 2018-07-25 01:06:08 -04:00
Tim Pope
07d30de8be Return relative paths with second argument to FugitivePath() 2018-07-25 01:04:36 -04:00
Tim Pope
c693da9cb0 Drop support for uppercase statusline indicator
If you want this, I'm happy to bring it back as a separate function.  I
think it's a bit too clever to detect automatically.
2018-07-25 01:04:36 -04:00
Tim Pope
1e7e707696 Preserve trailing slash in FugitiveReal() 2018-07-24 23:13:29 -04:00
Tim Pope
d818ac93af Make bang argument to :Glog explicit
Playing with some changes here and committing this part makes it easier
to reload the plugin after stashing changes.
2018-07-24 23:13:29 -04:00
Tim Pope
2fcf95467f Remove obsolete instaweb reference from README 2018-07-24 23:13:29 -04:00
Tim Pope
286476d58f Fix upwards navigation on "-" 2018-07-24 23:13:29 -04:00
Tim Pope
b78a8ab860 Remove indirection 2018-07-24 23:13:29 -04:00
Tim Pope
e6e3f3f225 Don't :cd if directory already correct 2018-07-24 19:58:01 -04:00
Tim Pope
240127f5a5 Eliminate use of buffer.commit()
Can't add a s:Commit() helper because that's the :Gcommit implementation
function, dang it.
2018-07-24 19:58:01 -04:00
Tim Pope
bfc1745f3b Handle bare repository case when shelling out 2018-07-23 13:55:50 -04:00
Tim Pope
93f29cf831 Fix shelling out from subdirectory
Closes https://github.com/tpope/vim-fugitive/issues/1061
2018-07-23 13:50:48 -04:00
Tim Pope
5879304769 Move GIT_INDEX_FILE override closer to home 2018-07-23 13:50:48 -04:00
Tim Pope
196e448375 Make :Gmove always relative to repository root 2018-07-22 19:16:17 -04:00
Tim Pope
e0b770a9bd Drop instaweb support
I had been considering extracting it, but it's so badly broken that
clearly nobody actually uses it.
2018-07-22 17:33:59 -04:00
Tim Pope
c938737960 Encapsulate fugitive#buffer().relative() 2018-07-22 16:17:17 -04:00
Tim Pope
978ca4a5ce Encapsulate fugitive#repo().git_chomp_in_tree() 2018-07-22 16:14:42 -04:00
Tim Pope
a8626a4ca4 Avoid false positive matches of status files in non-status buffers 2018-07-22 01:58:20 -04:00
Tim Pope
4a5781bc1b Fix issue generating Fugitive URLs 2018-07-22 01:57:39 -04:00
Tim Pope
71acb7da35 Provide FugitiveGenerate() and FugitiveParse() 2018-07-22 01:29:49 -04:00
Tim Pope
1e41a88ec9 Default to branch remote rather than origin 2018-07-21 21:53:26 -04:00
Tim Pope
9e7b67e9b0 Refactor repo.translate for future extraction 2018-07-21 21:53:26 -04:00
Tim Pope
445a8160d2 Provide Git dir to browse handlers 2018-07-21 21:53:26 -04:00
Tim Pope
cb49f8b4be Drop repo.dirglob 2018-07-21 21:53:26 -04:00
Tim Pope
6aa3f09eb7 Drop buffer.up 2018-07-21 21:42:34 -04:00
Tim Pope
197ca58a95 Remove unused variable 2018-07-21 21:42:34 -04:00
Tim Pope
7165817b69 Attempt 2 at fixing :Gbrowse tagname 2018-07-21 21:42:34 -04:00
Tim Pope
be68a8ec8a Add Git config query functions
Querying the remote URL is a behavior needed by Rhubarb and similar
plugins, so add a function for it in particular.
2018-07-21 17:36:51 -04:00
Tim Pope
b8046d1c5e Reduce noise on E211 from :Git 2018-07-21 17:36:51 -04:00
Tim Pope
b7e57637ba Add warning for editing invalid Fugitive URL
Closes https://github.com/tpope/vim-fugitive/issues/1060
2018-07-21 17:36:51 -04:00
Tim Pope
35f94eef48 Make argument to FugitiveTreeForGitDir optional 2018-07-21 15:43:10 -04:00
Tim Pope
c118dabb89 Fix :Glog
Closes https://github.com/tpope/vim-fugitive/issues/1059
2018-07-20 22:06:22 -04:00
Tim Pope
8c076e3f68 Drop some silly instance methods 2018-07-20 15:30:54 -04:00
Tim Pope
0aa3389f5c Decouple :Gcommit from repo object 2018-07-20 15:30:54 -04:00
Tim Pope
fb2289982b Rename overlooked snakecase function 2018-07-20 02:11:19 -04:00
Tim Pope
56e4947843 Support FileWriteCmd
This correctly requires a bang to write a partial file, but the error
message is E212 rather than the more appropriate E140.
2018-07-20 00:03:45 -04:00
Tim Pope
99f0431135 Thorough error reporting for broken system() calls 2018-07-19 02:59:29 -04:00
Tim Pope
29411e2801 Decouple autocommand functions from repo object 2018-07-19 02:59:29 -04:00
Tim Pope
c0b6faeae7 Support SourceCmd for Fugitive URLs 2018-07-18 20:11:19 -04:00
Tim Pope
792154e45d Unify FileReadCmd autocommands 2018-07-18 20:01:58 -04:00
Tim Pope
0717396aa2 Avoid some redundant --git-dir arguments 2018-07-18 20:01:58 -04:00
Tim Pope
9b9a81b170 Fix error on failure to load buffer 2018-07-18 20:01:58 -04:00
Tim Pope
598ad040b3 Fix b:fugitive_type in temp buffers 2018-07-18 19:46:48 -04:00
Tim Pope
805c0bbdd9 Fix i and a in :Gstatus
This is a stupid feature that needs to be ripped out.
2018-07-18 19:46:48 -04:00
Tim Pope
1971f8fd62 Restore highlight after warning message 2018-07-18 17:58:56 -04:00
Tim Pope
5ba918ea7b Support :Gread commit to read commit message 2018-07-17 01:42:57 -04:00
Tim Pope
27475a5d08 Provide function for preparing Git shell command 2018-07-17 01:42:57 -04:00
Tim Pope
e3b1af604c Work around bad b:git_dir from ftplugin/git.vim 2018-07-17 01:42:57 -04:00
Tim Pope
c9d6c83470 Loosen regexp to allow for Windows paths 2018-07-16 21:44:32 -04:00
Tim Pope
8df073165a Extract helper for robust tempname 2018-07-16 21:38:21 -04:00
Tim Pope
9bc425e943 Add missing function 2018-07-16 21:38:16 -04:00
Tim Pope
65346f0926 Fix readfile 2018-07-16 20:29:48 -04:00
Tim Pope
5a7469d899 Improve error reporting for BufReadCmd autocommands 2018-07-16 17:11:50 -04:00
Tim Pope
6f07b18012 Allow opting out of :terminal in Neovim
Closes https://github.com/tpope/vim-fugitive/issues/1051
2018-07-13 15:14:09 -04:00
Tim Pope
302f30c924 Handle :Gcommit % when working dir isn't Git dir 2018-07-11 00:21:03 -04:00
Tim Pope
7316baffdd Fix typo in regexp 2018-07-10 17:28:00 -04:00
Tim Pope
85c6c7a837 fugitive.vim 2.4
* Split into plugin, autoload, and ftdetect files.
* Support mods like :vertical on :Gstatus and :Gedit family.
* Provide :Grebase (no --interactive).
* Bug fixes.
2018-07-10 00:04:17 -04:00
Tim Pope
6f9fa8a4b1 Document P as preferred :Gcommit map for patching 2018-07-02 18:26:52 -04:00
Tim Pope
65a53b5f5c Guard against future NERDTree API changes 2018-07-02 15:12:09 -04:00
Tim Pope
0a75ec5d9b Provide file API
You can call these functions directly if you want, but they're designed
to be a generic interface for any URL:

    function! s:fcall(fn, file, ...) abort
      let ns = matchstr(a:file, '^\a\a\+\ze:')
      if len(ns) && exists('*' . ns . '#' . a:fn)
        return call(ns . '#' . a:fn, [a:file] + a:000)
      else
        return call(a:fn, [a:file] + a:000)
      endif
    endfunction
2018-07-01 20:22:25 -04:00
Tim Pope
80ff014d21 Add function alias
This might become the official version.
2018-06-29 18:11:17 -04:00
Tim Pope
b5f7c37d93 Replace buffer.path() with buffer.relative() 2018-06-28 15:44:22 -04:00
Tim Pope
6d2a83232a Handle bare repos in FugitivePath() 2018-06-28 15:43:52 -04:00
Tim Pope
ea38c7d664 Don't include newline in Git version 2018-06-28 15:43:52 -04:00
Tim Pope
2c30e116ed Avoid unnecessary IO in translate() 2018-06-27 20:25:43 -04:00
Tim Pope
1988518904 Rename FugitiveFilename() to FugitivePath() 2018-06-27 17:20:15 -04:00
Tim Pope
2a817bb53a Fix :Gbrowse tagname 2018-06-25 18:30:37 -04:00
Tim Pope
38c69cfebc Rename blob() to relative()
On second thought, we should exclude .git/ files from blob, so pick a
different name for now.
2018-06-25 16:44:11 -04:00
Tim Pope
70a36ceef8 Alias buffer.path() as buffer.blob()
Blob isn't a great name, but it's less ambiguous.
2018-06-25 16:05:57 -04:00
Tim Pope
f71079db4d Work around guioptions+=! on Windows
Closes https://github.com/tpope/vim-fugitive/issues/1042
2018-06-25 12:52:24 -04:00
Tim Pope
cbf96cc01a Clean up repetition in URL parsing 2018-06-20 18:28:25 -04:00
Tim Pope
8fa5cad8d7 Fix references to renamed functions 2018-06-20 18:05:43 -04:00
Tim Pope
251853bc1e Fix use of <Plug> in a <script> map
References https://github.com/tpope/vim-fugitive/issues/1044
2018-06-20 14:32:10 -04:00
Tim Pope
639b9f9a54 Fix load order issue setting up maps
References https://github.com/tpope/vim-fugitive/issues/1044
2018-06-20 14:24:35 -04:00
Tim Pope
13f39967f4 Loosen match for hunk header 2018-06-17 17:23:59 -04:00
Tim Pope
d39d5ca429 Accept alternate forms of Fugitive URL
This is to prepare for a potential transition to a URL replacement that
isn't mutilated by simplify().
2018-06-15 23:23:11 -04:00
Tim Pope
bb54881388 Jump directly to commit rather than ref file in more cases 2018-06-15 15:31:27 -04:00
Tim Pope
f7bcf51c56 Extract ftdetect file 2018-06-14 15:37:24 -04:00
Tim Pope
cc9d8d93c8 Add FugitiveFilename() to determine corresponding real file 2018-06-14 15:37:24 -04:00
rhysd
b571bff9ec Specify 'nowrite' to status buffer and blame buffer 2018-06-07 11:27:48 -04:00
Tim Pope
5c2095be39 Camel case public functions 2018-06-01 16:26:05 -04:00
Tim Pope
5d11ff7501 Extract autoload file 2018-06-01 16:26:05 -04:00
Tim Pope
dd4d4c7595 Update statusline function in README 2018-06-01 16:26:05 -04:00
Tim Pope
013ee636f5 Drop 'compatible' check
You really have to go out of your way to load a plugin in compatible
mode.
2018-06-01 13:38:22 -04:00
Tim Pope
ddec4bfa86 Move foldtext autocommand back to folding section 2018-06-01 13:25:29 -04:00
Tim Pope
f8913cda12 Fix :Gcommit invocation of :Gstatus
Closes https://github.com/tpope/vim-fugitive/issues/1034
2018-05-31 20:32:52 -04:00
Tim Pope
68e097db6f Gather up global autocommands and functions 2018-05-31 18:43:17 -04:00
Tim Pope
d850dff16e Expose Cmd autocommand functions 2018-05-31 18:43:17 -04:00
Tim Pope
8977570aa6 Handle symlinked directories more aggressively 2018-05-31 18:43:17 -04:00
Tim Pope
caf89d797f Provide official function for configured tree 2018-05-31 18:43:17 -04:00
Tim Pope
c8b1a7d9b6 Remove self evident comment 2018-05-31 18:43:17 -04:00
Tim Pope
0e2680f9ae Separate detection from initialization 2018-05-31 18:43:17 -04:00
Tim Pope
8c43505037 Provide :Grebase (no --interactive) 2018-05-31 18:43:17 -04:00
Tim Pope
fecd42864a Handle unusually named netrw buffers 2018-05-31 18:43:17 -04:00
Tim Pope
01e7a7e1e6 Switch out new and old official functions 2018-05-31 13:49:34 -04:00
Tim Pope
b129752c07 Fix maps that rely on s:Edit 2018-05-31 13:49:34 -04:00
Tim Pope
aa0210a986 Support <mods> on :Gstatus and :Gedit family 2018-05-30 00:49:48 -04:00
Tim Pope
d7c377f3ba Loosen regexps to accept alternate comment chars
References https://github.com/tpope/vim-fugitive/issues/1025
2018-05-30 00:49:48 -04:00
8 changed files with 6951 additions and 3372 deletions

1
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1 @@
github: tpope

View File

@@ -3,16 +3,20 @@
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:
Bring up an enhanced version of `git status` with `:G` (also known as
`:Gstatus`). Press `g?` to bring up a list of maps for numerous operations
including diffing, staging, committing, rebasing, and stashing.
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
write to it to stage the changes. Use `:Gdiffsplit` 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`. And guess
what `:Gcommit` does!
Commit, merge, and rebase with `:Gcommit`, `:Gmerge`, and `:Grebase`, using
the current Vim instance to edit commit messages and the rebase todo list.
Use `:Gpush`, `:Gfetch`, and `:Gpull` to send and retrieve upstream changes.
`:Gblame` brings up an interactive vertical split with `git blame`
output. Press enter on a line to edit the commit where the line
@@ -25,8 +29,9 @@ 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!
`:Gclog` and `:Gllog` load all previous commits into the quickfix or location
list. Give them a range (e.g., using visual mode and `:'<,'>Gclog`) to
iterate over every change to that portion of the current file.
`: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
@@ -36,20 +41,23 @@ 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 the web front-end of your favorite
hosting provider, with optional line range (try it in visual mode!). Built-in
support is provided for `git instaweb`, and plugins are available for popular
providers such as [GitHub][rhubarb.vim], [GitLab][fugitive-gitlab.vim], and
[Bitbucket][fubitive.vim].
hosting provider, with optional line range (try it in visual mode). Plugins
are available for popular providers such as [GitHub][rhubarb.vim],
[GitLab][fugitive-gitlab.vim], [Bitbucket][fubitive.vim],
[Gitee][fugitive-gitee.vim], and [Pagure][pagure].
[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
[fugitive-gitee.vim]: https://github.com/linuxsuren/fugitive-gitee.vim
[pagure]: https://github.com/FrostyX/vim-fugitive-pagure
Add `%{fugitive#statusline()}` to `'statusline'` to get an indicator
with the current branch in (surprise!) your statusline.
Add `%{FugitiveStatusline()}` to `'statusline'` to get an indicator
with the current branch in 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.
Last but not least, there's `:Git` for running any arbitrary command.
For more information, see `:help fugitive`.
## Screencasts
@@ -69,32 +77,22 @@ and paste:
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?
> Why can't I enter my password when I `:Gpush`?
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`.
It is highly recommended to use SSH keys or [credentials caching][] to avoid
entering your password on every upstream interaction. If this isn't an
option, the official solution is to use the `core.askPass` Git option to
request the password via a GUI. Fugitive will configure this for you
automatically if you have `ssh-askpass` or `git-gui` installed; otherwise it's
your responsibility to set this up.
> Here's a patch that automatically opens the quickfix window after
> `:Ggrep`.
As an absolute last resort, you can invoke `:Git --paginate push`. Fugitive
recognizes the pagination request and fires up a `:terminal`, which allows for
interactive password entry.
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
[credentials caching]: https://help.github.com/en/articles/caching-your-github-password-in-git
## Self-Promotion

6026
autoload/fugitive.vim Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -15,146 +15,152 @@ COMMANDS *fugitive-commands*
These commands are local to the buffers in which they work (generally, buffers
that are part of Git repositories).
*fugitive-:Git*
:Git [args] Run an arbitrary git command. Similar to :!git [args]
but chdir to the repository tree first.
*:Git* *fugitive-:G*
:Git {args} Run an arbitrary git command. Similar to :!git [args]
:G {args} but chdir to the repository tree first. For some
subcommands, a Fugitive command is called instead.
*fugitive-:Git!*
:Git! [args] Like |:Git|, but capture the output into a temp file,
and edit that temp file.
*:Git!*
:Git! {args} Like |:Git|, but capture the output into a temp file,
:Git --no-pager {args} and |:split| that temp file. Use :0Git to
:Git -P {args} |:edit| the temp file instead. A temp file is always
used for diff and log commands.
*fugitive-:Gcd*
:Gcd [directory] |:cd| relative to the repository.
*:Gstatus*
:Git Bring up a summary window vaguely akin to git-status.
:G Press g? or see |fugitive-maps| for usage.
:Gstatus
*fugitive-:Glcd*
:Glcd [directory] |:lcd| relative to the repository.
*:Git-commit* *:Gcommit*
:Git commit [args] A wrapper around git-commit. Unless the arguments
:Gcommit [args] given would skip the invocation of an editor (e.g.,
-m), a split window will be used to obtain a commit
message, or a new tab if -v is given. Write and close
the window (:wq) to finish the commit. To cancel, use
an empty message.
*fugitive-:Gstatus*
:Gstatus Bring up the output of git-status in the preview
window. The following maps, which work on the cursor
line file where sensible, are provided:
*:Git-revert* *:Grevert*
:Git revert [args] A wrapper around git-revert. Similar to |:Gcommit|.
:Grevert [args]
g? show this help
<C-N> next file
<C-P> previous file
<CR> |:Gedit|
- |:Git| add
- |:Git| reset (staged files)
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*
:Gcommit [args] A wrapper around git-commit. If there is nothing
to commit, |:Gstatus| is called instead. Unless the
arguments given would skip the invocation of an editor
(e.g., -m), a split window will be used to obtain a
commit message, or a new tab if -v is given. Write
and close that window (:wq or |:Gwrite|) to finish the
commit. Unlike when running the actual git-commit
command, it is possible (but unadvisable) to alter the
index with commands like git-add and git-reset while a
commit message is pending.
*fugitive-:Gmerge*
:Gmerge [args] Calls git-merge and loads errors and conflicted files
into the |quickfix| list. Opens a |:Gcommit| style
*:Git-merge* *:Gmerge*
:Git merge [args] Calls git-merge and loads errors and conflicted files
:Gmerge [args] 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.
*:Git-pull* *:Gpull*
:Git pull [args] Like |:Gmerge|, but for git-pull.
:Gpull [args]
*fugitive-:Gpush*
:Gpush [args] Invoke git-push, load the results into the |quickfix|
list, and invoke |:cwindow| to reveal any errors.
*:Git-rebase* *:Grebase*
:Git rebase [args] Like |:Gmerge|, but for git-rebase. Interactive
:Grebase [args] rebase is experimentally supported.
*:Git-push* *:Gpush*
:Git push [args] Invoke git-push, load the results into the |quickfix|
:Gpush [args] 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.
*:Git-fetch* *:Gfetch*
:Git fetch [args] Like |:Gpush|, but for git-fetch.
:Gfetch [args]
*fugitive-:Ggrep*
*:Git-blame* *:Gblame*
:Git blame [flags] Run git-blame [flags] on the current file and open the
:Gblame [flags] results in a scroll-bound vertical split. 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
C resize to end of commit column
D resize to end of date/time column
gq close blame, then |:Gedit| to return to work
tree version
<CR> close blame, and jump to patch that added line
(or directly to blob for boundary commit)
o jump to patch or blob in horizontal split
O jump to patch or blob in new tab
p jump to patch or blob in preview window
- reblame at commit
~ reblame at [count]th first grandparent
P reblame at [count]th parent (like HEAD^[count])
:[range]Gblame [flags] If a range is given, just that part of the file will
:Gblame [flags] {file} be blamed, and a horizontal split without
:Git blame ... scrollbinding is used. You can also give an arbitrary
filename.
*:Ggrep* *:Gcgrep* *:Git-grep*
:Ggrep[!] [args] |:grep|[!] with git-grep as 'grepprg'.
:Git[!] grep [args]
*fugitive-:Glgrep*
*:Glgrep*
:Glgrep[!] [args] |:lgrep|[!] with git-grep as 'grepprg'.
:0Git[!] grep [args]
*fugitive-:Glog*
:Glog [args] Load all previous revisions of the current file into
the |quickfix| list. Additional git-log arguments can
be given (for example, --reverse). If "--" appears as
an argument, no file specific filtering is done, and
previous commits rather than previous file revisions
are loaded.
*:Gclog* *:Glog*
:Gclog[!] [args] Use git-log [args] to load the commit history into the
:Glog[!] [args] |quickfix| list. Jump to the first commit unless [!]
is given.
:{range}Glog [args] Use git-log -L to load previous revisions of the given
:{range}Gclog[!] [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.
first diff hunk for each commit. Use :0Gclog to
target the entire file.
*fugitive-:Gllog*
:Gllog [args] Like |:Glog|, but use the location list instead of the
*:Gllog*
:Gllog [args] Like |:Gclog|, but use the location list instead of the
|quickfix| list.
*fugitive-:Gedit* *fugitive-:Ge*
:Gedit [revision] |:edit| a |fugitive-revision|.
*:Gcd*
:Gcd [directory] |:cd| relative to the repository.
*fugitive-:Gsplit*
:Gsplit [revision] |:split| a |fugitive-revision|.
*:Glcd*
:Glcd [directory] |:lcd| relative to the repository.
*fugitive-:Gvsplit*
:Gvsplit [revision] |:vsplit| a |fugitive-revision|.
*:Gedit* *fugitive-:Ge*
:Gedit [object] |:edit| a |fugitive-object|.
*fugitive-:Gtabedit*
:Gtabedit [revision] |:tabedit| a |fugitive-revision|.
*:Gsplit*
:Gsplit [object] |:split| a |fugitive-object|.
*fugitive-:Gpedit*
:Gpedit [revision] |:pedit| a |fugitive-revision|.
*:Gvsplit*
:Gvsplit [object] |:vsplit| a |fugitive-object|.
: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.
*:Gtabedit*
:Gtabedit [object] |:tabedit| a |fugitive-object|.
*fugitive-:Gread*
:Gread [revision] Empty the buffer and |:read| a |fugitive-revision|.
*:Gpedit*
:Gpedit [object] |:pedit| a |fugitive-object|.
:Gsplit! [args] *:Gsplit!* *:Gvsplit!*
:Gvsplit! [args] *:Gtabedit!* *:Gpedit!*
:Gtabedit! [args] Capture the output of `git [args]` to a temp file and
:Gpedit! [args] open it in a split, tab, or preview window. Use
:0Gsplit! to suppress the split and open it in the
current window.
*:Gread* *fugitive-:Gr*
:Gread [object] Empty the buffer and |:read| a |fugitive-object|.
When the argument is omitted, this is similar to
git-checkout on a work tree file or git-add on a stage
file, but without writing anything to disk.
:{range}Gread [revision]
|:read| in a |fugitive-revision| after {range}.
:{range}Gread [object] |:read| in a |fugitive-object| after {range}.
*fugitive-:Gread!*
*:Gread!* *fugitive-:Gr!*
: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}.
:{range}Gread! [args] |:read| the output of a Git command after {range}.
*fugitive-:Gw* *fugitive-:Gwrite*
*:Gwrite* *fugitive-:Gw*
:Gwrite Write to the current file's path and stage the results.
When run in a work tree file, it is effectively git
add. Elsewhere, it is effectively git-checkout. A
@@ -164,79 +170,60 @@ that are part of Git repositories).
:Gwrite {path} You can give |:Gwrite| an explicit path of where in
the work tree to write. You can also give a path like
:0:foo.txt or even :0 to write to just that stage in
:0:foo.txt or :0:% to write to just that stage in
the index.
*fugitive-:Gwq*
*: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*
:Gdiff [revision] Perform a |vimdiff| against the current file in the
given revision. With no argument, the version in the
index is used (which means a three-way diff during a
merge conflict, making it a git-mergetool
alternative). The newer of the two files is placed
to the right or bottom, depending on 'diffopt' and
the width of the window relative to 'textwidth'. Use
|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.
*:Gdiffsplit*
:Gdiffsplit [object] Perform a |vimdiff| against the given file, or if a
commit is given, the current file in that commit.
With no argument, the version in the index or work
tree is used. The newer of the two files is placed to
the right or bottom, depending on 'diffopt' and the
width of the window relative to 'textwidth'. Use
Vim's |do| and |dp| to stage and unstage changes.
*fugitive-:Gsdiff*
:Gsdiff [revision] Like |:Gdiff|, but always split horizontally.
*:Gdiffsplit!*
:Gdiffsplit! Diff against any and all direct ancestors, retaining
focus on the current window. During a merge conflict,
this is a three-way diff against the "ours" and
"theirs" ancestors. Additional d2o and d3o maps are
provided to to obtain the hunk from the "ours" or
"theirs" ancestor, respectively.
*fugitive-:Gvdiff*
:Gvdiff [revision] Like |:Gdiff|, but always split vertically.
:Gdiffsplit! {object} Like |:Gdiffsplit|, but retain focus on the current
window.
*fugitive-:Gmove*
*:Gvdiffsplit*
:Gvdiffsplit [object] Like |:Gdiffsplit|, but always split vertically.
*:Ghdiffsplit* *:Gsdiff*
:Ghdiffsplit [object] Like |:Gdiffsplit|, but always split horizontally.
*:Gmove*
:Gmove {destination} Wrapper around git-mv that renames the buffer
afterward. The destination is relative to the current
directory except when started with a /, in which case
it is relative to the work tree. (This is a holdover
from before |:Grename| and will be removed.) Add a !
to pass -f.
afterward. Add a ! to pass -f.
*fugitive-:Grename*
*:Grename*
:Grename {destination} Like |:Gmove| but operates relative to the parent
directory of the current file.
*fugitive-:Gdelete*
*:Gdelete*
:Gdelete Wrapper around git-rm that deletes the buffer
afterward. When invoked in an index file, --cached is
passed. Add a ! to pass -f and forcefully discard the
buffer.
*fugitive-:Gremove*
*:Gremove*
:Gremove Like :Gdelete, but keep the (now empty) buffer around.
*fugitive-:Gblame*
:Gblame [flags] Run git-blame on the file and open the results in a
scroll bound vertical split. 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:
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.
*fugitive-:Gbrowse*
*:Gbrowse*
:Gbrowse Open the current file, blob, tree, commit, or tag
in your browser at the upstream hosting provider.
If a range is given, it is appropriately appended to
@@ -247,115 +234,390 @@ that are part of Git repositories).
supported by installing rhubarb.vim, available at
<https://github.com/tpope/vim-rhubarb>.
The hosting provider is determined by looking at the
remote for the current or specified branch and falls
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
latest commit rather than a volatile branch.
:Gbrowse {object} Like :Gbrowse, but for a given |fugitive-object|.
: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.
determine which upstream 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.
selected lines. This also forces the URL to include a
commit rather than a branch name so it remains valid
if the file changes. You can give a range of "0" to
force this behavior without including an anchor.
:[range]Gbrowse! [args] Like :Gbrowse, but put the URL on the clipboard rather
than opening it.
MAPPINGS *fugitive-mappings*
MAPS *fugitive-maps*
These maps are available everywhere.
These maps are available in both the |:Gstatus| buffer and Fugitive object
buffers, although not all maps make sense in all buffers. Mappings that
operate on the file or hunk under the cursor are generally available in visual
mode to operate on multiple files or partial hunks.
*fugitive-c_CTRL-R_CTRL-G*
*fugitive-staging-maps*
Staging/unstaging maps ~
*fugitive_s*
s Stage (add) the file or hunk under the cursor.
*fugitive_u*
u Unstage (reset) the file or hunk under the cursor.
*fugitive_-*
- Stage or unstage the file or hunk under the cursor.
*fugitive_U*
U Unstage everything.
*fugitive_X*
X Discard the change under the cursor. This uses
`checkout` or `clean` under the hood. A command is
echoed that shows how to undo the change. Consult
`:messages` to see it again. You can use this during
a merge conflict do discard "our" changes (--theirs)
in the "Unstaged" section or discard "their" changes
(--ours) in the "Staged" section.
*fugitive_=*
= Toggle an inline diff of the file under the cursor.
*fugitive_>*
> Insert an inline diff of the file under the cursor.
*fugitive_<*
< Remove the inline diff of the file under the cursor.
*fugitive_gI*
gI Open .git/info/exclude in a split and add the file
under the cursor. Use a count to open .gitignore.
*fugitive_I*
I Invoke |:Git| add --patch or reset --patch on the file
P under the cursor. On untracked files, this instead
calls |:Git| add --intent-to-add.
*fugitive_d*
Diff maps ~
*fugitive_dp*
dp Invoke |:Git!| diff on the file under the cursor.
Deprecated in favor of inline diffs.
*fugitive_dd*
dd Perform a |:Gdiffsplit| on the file under the cursor.
*fugitive_dv*
dv Perform a |:Gvdiffsplit| on the file under the cursor.
*fugitive_ds* *fugitive_dh*
ds Perform a |:Ghdiffsplit| on the file under the cursor.
dh
*fugitive_dq*
dq Close all but one diff buffer, and |:diffoff|! the
last one.
*fugitive_d?*
d? Show this help.
*fugitive-navigation-maps*
Navigation maps ~
*fugitive_<CR>*
<CR> Open the file or |fugitive-object| under the cursor.
in a blob, this and similar maps jump to the patch
from the diff where this was added, or where it was
removed if a count was given. If the line is still in
the work tree version, passing a count takes you to
it.
*fugitive_o*
o Open the file or |fugitive-object| under the cursor in
a new split.
*fugitive_gO*
gO Open the file or |fugitive-object| under the cursor in
a new vertical split.
*fugitive_O*
O Open the file or |fugitive-object| under the cursor in
a new tab.
*fugitive_p*
p Open the file or |fugitive-object| under the cursor in
a preview window. In the status buffer, 1p is
required to bypass the legacy usage instructions.
*fugitive_~*
~ Open the current file in the [count]th first ancestor.
*fugitive_P*
P Open the current file in the [count]th parent.
*fugitive_C*
C Open the commit containing the current file.
*fugitive_CTRL-P* *fugitive_(*
( Jump to the previous file, hunk, or revision.
*fugitive_CTRL-N* *fugitive_)*
) Jump to the next file, hunk, or revision.
*fugitive_[c*
[c Jump to previous hunk, expanding inline diffs
automatically. (This shadows the Vim built-in |[c|
that provides a similar operation in |diff| mode.)
*fugitive_]c*
]c Jump to next hunk, expanding inline diffs
automatically. (This shadows the Vim built-in |]c|
that provides a similar operation in |diff| mode.)
*fugitive_[/* *fugitive_[m*
[/ Jump to previous file, collapsing inline diffs
[m automatically. (Mnemonic: "/" appears in filenames,
"m" appears in "filenames".)
*fugitive_]/* *fugitive_]m*
]/ Jump to next file, collapsing inline diffs
]m automatically. (Mnemonic: "/" appears in filenames,
"m" appears in "filenames".)
*fugitive_i*
i Jump to the next file or hunk, expanding inline diffs
automatically.
*fugitive_[[*
[[ Jump [count] sections backward.
*fugitive_]]*
]] Jump [count] sections forward.
*fugitive_[]*
[] Jump [count] section ends backward.
*fugitive_][*
][ Jump [count] section ends forward.
*fugitive_star*
* One the first column of a + or - diff line, search for
the corresponding - or + line. Otherwise, defer to
built-in |star|.
*fugitive_#*
# Same as "*", but search backward.
*fugitive_gu*
gu Jump to file [count] in the "Untracked" or "Unstaged"
section.
*fugitive_gU*
gU Jump to file [count] in the "Unstaged" section.
*fugitive_gs*
gs Jump to file [count] in the "Staged" section.
*fugitive_gp*
gp Jump to file [count] in the "Unpushed" section.
*fugitive_gP*
gP Jump to file [count] in the "Unpulled" section.
*fugitive_gr*
gr Jump to file [count] in the "Rebasing" section.
*fugitive_gi*
gi Open .git/info/exclude in a split. Use a count to
open .gitignore.
*fugitive_c*
Commit maps ~
cc Create a commit.
ca Amend the last commit and edit the message.
ce Amend the last commit without editing the message.
cw Reword the last commit.
cvc Create a commit with -v.
cva Amend the last commit with -v
cf Create a `fixup!` commit for the commit under the
cursor.
cF Create a `fixup!` commit for the commit under the
cursor and immediately rebase it.
cs Create a `squash!` commit for the commit under the
cursor.
cS Create a `squash!` commit for the commit under the
cursor and immediately rebase it.
cA Create a `squash!` commit for the commit under the
cursor and edit the message.
c<Space> Populate command line with ":Git commit ".
*fugitive_cr*
crc Revert the commit under the cursor.
crn Revert the commit under the cursor in the index and
work tree, but do not actually commit the changes.
cr<Space> Populate command line with ":Git revert ".
*fugitive_cm*
cm<Space> Populate command line with ":Git merge ".
c? Show this help.
*fugitive_cb*
*fugitive_co*
Checkout/branch maps ~
coo Check out the commit under the cursor.
cb<Space> Populate command line with ":Git branch ".
co<Space> Populate command line with ":Git checkout ".
cb? Show this help.
co?
*fugitive_cz*
Stash maps ~
czz Push stash. Pass a [count] of 1 to add
`--include-untracked` or 2 to add `--all`.
czw Push stash of worktree. Like `czz` with
`--include-index`.
czA Apply topmost stash, or stash@{count}.
cza Apply topmost stash, or stash@{count}, preserving the
index.
czP Pop topmost stash, or stash@{count}.
czp Pop topmost stash, or stash@{count}, preserving the
index.
cz<Space> Populate command line with ":Git stash ".
cz? Show this help.
*fugitive_r*
Rebase maps ~
ri Perform an interactive rebase. Uses ancestor of
u commit under cursor as upstream if available.
rf Perform an autosquash rebase without editing the todo
list. Uses ancestor of commit under cursor as
upstream if available.
ru Perform an interactive rebase against @{upstream}.
rp Perform an interactive rebase against @{push}.
rr Continue the current rebase.
rs Skip the current commit and continue the current
rebase.
ra Abort the current rebase.
re Edit the current rebase todo list.
rw Perform an interactive rebase with the commit under
the cursor set to `reword`.
rm Perform an interactive rebase with the commit under
the cursor set to `edit`.
rd Perform an interactive rebase with the commit under
the cursor set to `drop`.
r<Space> Populate command line with ":Git rebase ".
r? Show this help.
*fugitive-misc-maps*
Miscellaneous maps ~
*fugitive_gq* *fugitive_q*
gq Close the status buffer.
*fugitive_.*
. Start a |:| command line with the file under the
cursor prepopulated.
*fugitive_g?*
g? Show help for |fugitive-maps|.
*fugitive-global-maps*
Global maps ~
*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-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.
*fugitive_y_CTRL-G*
["x]y<C-G> Yank the path to the current |fugitive-object|.
These maps are available in Git objects.
*g:fugitive_no_maps*
Global maps can be disabled with the g:fugitive_no_maps option.
>
let g:fugitive_no_maps = 1
<
SPECIFYING OBJECTS *fugitive-object* *fugitive-revision*
*fugitive-<CR>*
<CR> Jump to the revision under the cursor.
Fugitive objects are either work tree files or Git revisions as defined in the
"SPECIFYING REVISIONS" section in the git-rev-parse man page, with expansions
inspired by |cmdline-special| layered on top. For commands that accept an
optional object, the default is the file in the index for work tree files and
the work tree file for everything else. Example objects follow.
*fugitive-o*
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*
O Jump to the revision under the cursor in a new tab.
*fugitive--*
- Go to the tree containing the current tree or blob.
*fugitive-~*
~ Go to the current file in the [count]th first
ancestor.
*fugitive-P*
P Go to the current file in the [count]th parent.
*fugitive-C*
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*
a Show the current tag, commit, or tree in an alternate
format.
SPECIFYING REVISIONS *fugitive-revision*
Fugitive revisions are similar to Git revisions as defined in the "SPECIFYING
REVISIONS" section in the git-rev-parse man page. For commands that accept an
optional revision, the default is the file in the index for work tree files
and the work tree file for everything else. Example revisions follow.
Revision Meaning ~
HEAD .git/HEAD
master .git/refs/heads/master
HEAD^{} The commit referenced by HEAD
HEAD^ The parent of the commit referenced by HEAD
HEAD: The tree referenced by HEAD
/HEAD The file named HEAD in the work tree
Object Meaning ~
@ The commit referenced by @ aka HEAD
master The commit referenced by master
master^ The parent of the commit referenced by master
master...other The merge base of master and other
master: The tree referenced by master
./master The file named master in the working directory
:(top)master The file named master in the work tree
Makefile The file named Makefile in the work tree
HEAD^:Makefile The file named Makefile in the parent of HEAD
@^:Makefile The file named Makefile in the parent of HEAD
:Makefile The file named Makefile in the index (writable)
- The current file in HEAD
^ The current file in the previous commit
~3 The current file 3 commits ago
: .git/index (Same as |:Gstatus|)
:0 The current file in the index
:1 The current file's common ancestor during a conflict
:2 The current file in the target branch during a conflict
:3 The current file in the merged branch during a conflict
:/foo The most recent commit with "foo" in the message
@~2:% The current file in the grandparent of HEAD
:% The current file in the index
:1:% The current file's common ancestor during a conflict
:2:# The alternate file in the target branch during a conflict
:3:#5 The file from buffer #5 in the merged branch during a conflict
! The commit owning the current file
!:Makefile The file named Makefile in the commit owning the current file
!3^2 The second parent of the commit owning buffer #3
.git/config The repo config file
: Same as |:Gstatus|
STATUSLINE *fugitive-statusline*
*fugitive#statusline()*
Add %{fugitive#statusline()} to your statusline to get an indicator including
*FugitiveStatusline()* *fugitive#statusline()*
Add %{FugitiveStatusline()} to your statusline to get an indicator including
the current branch and the currently edited file's commit. If you don't have
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%{FugitiveStatusline()}%=%-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
*FugitiveHead(...)* *fugitive#head(...)*
Use FugitiveHead() to return the name of the current branch. If the current
HEAD is detached, FugitiveHead() 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.
@@ -363,6 +625,6 @@ ABOUT *fugitive-about*
Grab the latest version or report a bug on GitHub:
http://github.com/tpope/vim-fugitive
https://github.com/tpope/vim-fugitive
vim:tw=78:et:ft=help:norl:

1
ftdetect/fugitive.vim Normal file
View File

@@ -0,0 +1 @@
autocmd BufReadPost *.fugitiveblame setfiletype fugitiveblame

File diff suppressed because it is too large Load Diff

51
syntax/fugitive.vim Normal file
View File

@@ -0,0 +1,51 @@
if exists("b:current_syntax")
finish
endif
syn sync fromstart
syn spell notoplevel
syn include @fugitiveDiff syntax/diff.vim
syn match fugitiveHeader /^[A-Z][a-z][^:]*:/ nextgroup=fugitiveHash,fugitiveSymbolicRef skipwhite
syn region fugitiveSection start=/^\%(.*(\d\+)$\)\@=/ contains=fugitiveHeading end=/^$/
syn cluster fugitiveSection contains=fugitiveSection
syn match fugitiveHeading /^[A-Z][a-z][^:]*\ze (\d\+)$/ contains=fugitivePreposition contained nextgroup=fugitiveCount skipwhite
syn match fugitiveCount /(\d\+)/hs=s+1,he=e-1 contained
syn match fugitivePreposition /\<\%([io]nto\|from\|to\|Rebasing\%( detached\)\=\)\>/ transparent contained nextgroup=fugitiveHash,fugitiveSymbolicRef skipwhite
syn match fugitiveInstruction /^\l\l\+\>/ contained containedin=@fugitiveSection nextgroup=fugitiveHash skipwhite
syn match fugitiveDone /^done\>/ contained containedin=@fugitiveSection nextgroup=fugitiveHash skipwhite
syn match fugitiveStop /^stop\>/ contained containedin=@fugitiveSection nextgroup=fugitiveHash skipwhite
syn match fugitiveModifier /^[MADRCU?]\{1,2} / contained containedin=@fugitiveSection
syn match fugitiveSymbolicRef /\.\@!\%(\.\.\@!\|[^[:space:][:cntrl:]\:.]\)\+\.\@<!/ contained
syn match fugitiveHash /^\x\{4,\}\>/ contained containedin=@fugitiveSection
syn match fugitiveHash /\<\x\{4,\}\>/ contained
syn region fugitiveHunk start=/^\%(@@\+ -\)\@=/ end=/^\%([A-Za-z?@]\|$\)\@=/ contains=@fugitiveDiff containedin=@fugitiveSection fold
for s:section in ['Untracked', 'Unstaged', 'Staged']
exe 'syn region fugitive' . s:section . 'Section start=/^\%(' . s:section . ' .*(\d\+)$\)\@=/ contains=fugitive' . s:section . 'Heading end=/^$/'
exe 'syn match fugitive' . s:section . 'Modifier /^[MADRCU?] / contained containedin=fugitive' . s:section . 'Section'
exe 'syn cluster fugitiveSection add=fugitive' . s:section . 'Section'
exe 'syn match fugitive' . s:section . 'Heading /^[A-Z][a-z][^:]*\ze (\d\+)$/ contains=fugitivePreposition contained nextgroup=fugitiveCount skipwhite'
endfor
unlet s:section
hi def link fugitiveHeader Label
hi def link fugitiveHeading PreProc
hi def link fugitiveUntrackedHeading PreCondit
hi def link fugitiveUnstagedHeading Macro
hi def link fugitiveStagedHeading Include
hi def link fugitiveModifier Type
hi def link fugitiveUntrackedModifier StorageClass
hi def link fugitiveUnstagedModifier Structure
hi def link fugitiveStagedModifier Typedef
hi def link fugitiveInstruction Type
hi def link fugitiveStop Function
hi def link fugitiveHash Identifier
hi def link fugitiveSymbolicRef Function
hi def link fugitiveCount Number
let b:current_syntax = "fugitive"

7
syntax/fugitiveblame.vim Normal file
View File

@@ -0,0 +1,7 @@
if exists("b:current_syntax")
finish
endif
call fugitive#BlameSyntax()
let b:current_syntax = "fugitiveblame"