I know that you can use GWrite
to stage current file. You can also use GStatus
and -
to stage the file you are selecting.
Is there a way to GWrite
all the files or do git add .
without using GStatus
?
I know that you can use GWrite
to stage current file. You can also use GStatus
and -
to stage the file you are selecting.
Is there a way to GWrite
all the files or do git add .
without using GStatus
?
Not the answer to your specific question but something I've learned from one of the screencasts specified in github/tpope/vim-fugitive/README.markdown is you can do a visual select all file lines, -
to stage them all, then cc
to commit, all from within the Gstatus
screen.
See :h :Git
, which can
Run an arbitrary git command. Similar to :!git [args] but chdir to the repository tree first.
:Git add .
I think you can just add a number before -
. E.g. 5-
to stage/unstage 5 of them.
Now I have the following in my .vimrc
:
augroup custom_fugitive_mappings
" delete custom_fugitive_mappings to avoid double runs
au!
" map 'A' to stage all in git status window
au User FugitiveIndex nnoremap <buffer> A :Git add .<cr>
augroup END