Skip to content

Commit

Permalink
Add cW map as commit --fixup=reword:
Browse files Browse the repository at this point in the history
References: #2369
  • Loading branch information
tpope committed Jan 20, 2025
1 parent f4e8453 commit d74a7cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions autoload/fugitive.vim
Original file line number Diff line number Diff line change
Expand Up @@ -7917,6 +7917,7 @@ function! s:MapGitOps(is_ftplugin) abort
exe s:Map('n', 'cc', ':<C-U>Git commit<CR>', '<silent>', ft)
exe s:Map('n', 'ce', ':<C-U>Git commit --amend --no-edit<CR>', '<silent>', ft)
exe s:Map('n', 'cw', ':<C-U>Git commit --amend --only<CR>', '<silent>', ft)
exe s:Map('n', 'cW', ':<C-U>Git commit --fixup=reword:<C-R>=<SID>SquashArgument()<CR>', '', ft)
exe s:Map('n', 'cva', ':<C-U>tab Git commit -v --amend<CR>', '<silent>', ft)
exe s:Map('n', 'cvc', ':<C-U>tab Git commit -v<CR>', '<silent>', ft)
exe s:Map('n', 'cRa', ':<C-U>Git commit --reset-author --amend<CR>', '<silent>', ft)
Expand Down
9 changes: 6 additions & 3 deletions doc/fugitive.txt
Original file line number Diff line number Diff line change
Expand Up @@ -465,15 +465,18 @@ Commit maps ~

cc Create a commit.

cvc Create a commit with -v.

ca Amend the last commit and edit the message.

cva Amend the last commit with -v.

ce Amend the last commit without editing the message.

cw Reword the last commit.

cvc Create a commit with -v.

cva Amend the last commit with -v
cW Create an `amend!` commit that rewords the commit
under the cursor.

cf Create a `fixup!` commit for the commit under the
cursor.
Expand Down

0 comments on commit d74a7cf

Please sign in to comment.