diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index bae8898..3805ee0 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -1422,7 +1422,6 @@ function! fugitive#BufReadStatus() abort nnoremap a :let b:fugitive_display_format += 1exe fugitive#BufReadStatus() nnoremap i :let b:fugitive_display_format -= 1exe fugitive#BufReadStatus() nnoremap C :Gcommit:echohl WarningMsgecho ':Gstatus C is deprecated in favor of cc'echohl NONE - nnoremap cA :Gcommit --amend --reuse-message=HEAD:echohl WarningMsgecho ':Gstatus cA is deprecated in favor of ce'echohl NONE nnoremap ca :Gcommit --amend nnoremap cc :Gcommit nnoremap ce :Gcommit --amend --no-edit @@ -3529,6 +3528,10 @@ function! s:ContainingCommit() abort return empty(commit) ? 'HEAD' : commit endfunction +function! s:SquashArgument() abort + return s:Owner(@%) +endfunction + function! s:NavigateUp(count) abort let rev = substitute(s:DirRev(@%)[1], '^$', ':', 'g') let c = a:count @@ -3577,6 +3580,9 @@ function! fugitive#MapJumps(...) abort nnoremap cS :exe 'Gvsplit ' . fnameescape(ContainingCommit()) nnoremap cO :exe 'Gtabedit ' . fnameescape(ContainingCommit()) nnoremap cp :exe 'Gpedit ' . fnameescape(ContainingCommit()) + nnoremap cf :Gcommit --fixup==SquashArgument() + nnoremap cs :Gcommit --squash==SquashArgument() + nnoremap cA :Gcommit --edit --squash==SquashArgument() nmap . : endif endfunction diff --git a/doc/fugitive.txt b/doc/fugitive.txt index 625694e..c6bab86 100644 --- a/doc/fugitive.txt +++ b/doc/fugitive.txt @@ -47,6 +47,9 @@ that are part of Git repositories). cw |:Gcommit| --amend --only cva |:Gcommit| --verbose --amend cvc |:Gcommit| --verbose + cf |:Gcommit| --fixup= + cs |:Gcommit| --squash= + cA |:Gcommit| --edit --squash= D |:Gdiff| ds |:Gsdiff| dp |:Git!| diff (p for patch; use :Gw to apply)