This was done in d4fb2a2f5c2023f477beae6aef47cf0457351e6e to fix
filetype modelines, but it appears to no longer be necessary and is
confusing other plugins.
This was changed in 1ac2c70 for the other git commands, leading to the
following error message:
```
E118: Too many arguments for function: s:ReadCommand
```
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.
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.
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
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
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