Skip to content

Commit d74a7cf

Browse files
committed
Add cW map as commit --fixup=reword:
References: #2369
1 parent f4e8453 commit d74a7cf

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

autoload/fugitive.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7917,6 +7917,7 @@ function! s:MapGitOps(is_ftplugin) abort
79177917
exe s:Map('n', 'cc', ':<C-U>Git commit<CR>', '<silent>', ft)
79187918
exe s:Map('n', 'ce', ':<C-U>Git commit --amend --no-edit<CR>', '<silent>', ft)
79197919
exe s:Map('n', 'cw', ':<C-U>Git commit --amend --only<CR>', '<silent>', ft)
7920+
exe s:Map('n', 'cW', ':<C-U>Git commit --fixup=reword:<C-R>=<SID>SquashArgument()<CR>', '', ft)
79207921
exe s:Map('n', 'cva', ':<C-U>tab Git commit -v --amend<CR>', '<silent>', ft)
79217922
exe s:Map('n', 'cvc', ':<C-U>tab Git commit -v<CR>', '<silent>', ft)
79227923
exe s:Map('n', 'cRa', ':<C-U>Git commit --reset-author --amend<CR>', '<silent>', ft)

doc/fugitive.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,15 +465,18 @@ Commit maps ~
465465

466466
cc Create a commit.
467467

468+
cvc Create a commit with -v.
469+
468470
ca Amend the last commit and edit the message.
469471

472+
cva Amend the last commit with -v.
473+
470474
ce Amend the last commit without editing the message.
471475

472476
cw Reword the last commit.
473477

474-
cvc Create a commit with -v.
475-
476-
cva Amend the last commit with -v
478+
cW Create an `amend!` commit that rewords the commit
479+
under the cursor.
477480

478481
cf Create a `fixup!` commit for the commit under the
479482
cursor.

0 commit comments

Comments
 (0)