The long term goal is to use :Gsomecommand for commands that wrap
Vim built-ins (e.g., :Gedit for :edit), :Git some-command for commands
that wrap Git built-ins, and :GSomeCommand for everything else. For
:GRemove, :GDelete, :GMove, and :GRename, this gives us symmetry with
eunuch.vim, and for :GBrowse, this gives us symmetry with a hypothetical
:Browse command that I've long wanted to make a plugin for but probably
never will.
:GcLog and :GlLog get their names because they match Vim's :c and :l
prefixes but bring their own custom suffix. This is rather unsatisfying
and I may change it if something better comes along.
In particular, this fixes `FugitiveFind(..., '')` to respect the empty
Git dir argument rather than falling back to detection on the current
working directory. Which in turn fixes :Gstatus using the current
working directory when called from a buffer that does not belong to a
repository.
References https://github.com/tpope/vim-fugitive/issues/1408
* 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.
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
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.
* 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.
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', @%)
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