:G :G status :G commit :G add % :Gdiff :G push :Glog
Add current file and commit with diff in a split
function! s:GitAdd() exe "G add %" exe "G diff --staged" exe "only" exe "G commit" endfunction :command! GitAdd :call s:GitAdd() nnoremap gic :GitAdd<CR>
:on[ly] will make the current buffer the only one on the screen. This is super helpful as many of fugitive commands will open in a split by default.
cycle through the jumplist
This one has nothing to do with fugitive, but is a native vim feature that
makes fugitive glorious. Before I realized how to utilize
would get completely lost when using fugitive. Digging deep into the log,
opening a file from a specific commit, then no way to get back where I was in
show the jumplist
The jumplist is sorted Oldest to newest
When navigating the jumplist with
, it will add a new entry
to the jumplist and let you get back to where you were with a
:Telescope jumplist adds to the jumplist
C-W J / C-W L
:G log :G log -p :Glog
:Ggrep python **/*md
you don't need to specify a file glob.
In the file you want to stage hunks of run
. Then use vim's diff
) to move the hunk between the
stage/index. Then write the file to stage.
:Gdiff dp :w :Gcommit