Add cW map as commit --fixup=reword:

References: https://github.com/tpope/vim-fugitive/pull/2369
This commit is contained in:
Tim Pope
2025-01-20 01:29:31 -05:00
parent f4e8453ce7
commit d74a7cff4c
2 changed files with 7 additions and 3 deletions

View File

@@ -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)

View File

@@ -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.