Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support git commit --fixup=amend:<commit> and --fixup=reword:<commit> keymaps #2369

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion autoload/fugitive.vim
Original file line number Diff line number Diff line change
Expand Up @@ -7923,10 +7923,12 @@ function! s:MapGitOps(is_ftplugin) abort
exe s:Map('n', 'cRe', ':<C-U>Git commit --reset-author --amend --no-edit<CR>', '<silent>', ft)
exe s:Map('n', 'cRw', ':<C-U>Git commit --reset-author --amend --only<CR>', '<silent>', ft)
exe s:Map('n', 'cf', ':<C-U>Git commit --fixup=<C-R>=<SID>SquashArgument()<CR>', '', ft)
exe s:Map('n', 'cA', ':<C-U>Git commit --edit --fixup=amend:<C-R>=<SID>SquashArgument()<CR>', '', ft)
exe s:Map('n', 'cW', ':<C-U>Git commit --edit --fixup=reword:<C-R>=<SID>SquashArgument()<CR>', '', ft)
exe s:Map('n', 'cF', ':<C-U><Bar>Git -c sequence.editor=true rebase --interactive --autosquash<C-R>=<SID>RebaseArgument()<CR><Home>Git commit --fixup=<C-R>=<SID>SquashArgument()<CR>', '', ft)
exe s:Map('n', 'cs', ':<C-U>Git commit --no-edit --squash=<C-R>=<SID>SquashArgument()<CR>', '', ft)
exe s:Map('n', 'cS', ':<C-U><Bar>Git -c sequence.editor=true rebase --interactive --autosquash<C-R>=<SID>RebaseArgument()<CR><Home>Git commit --no-edit --squash=<C-R>=<SID>SquashArgument()<CR>', '', ft)
exe s:Map('n', 'cA', ':<C-U>Git commit --edit --squash=<C-R>=<SID>SquashArgument()<CR>', '', ft)
exe s:Map('n', 'cn', ':<C-U>Git commit --edit --squash=<C-R>=<SID>SquashArgument()<CR>', '', ft)
exe s:Map('n', 'c?', ':<C-U>help fugitive_c<CR>', '<silent>', ft)

exe s:Map('n', 'cr<Space>', ':Git revert<Space>', '', ft)
Expand Down
8 changes: 7 additions & 1 deletion doc/fugitive.txt
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,12 @@ cva Amend the last commit with -v
cf Create a `fixup!` commit for the commit under the
cursor.

cA Create an `amend!` (`--fixup=amend:`) commit for
the commit under the cursor.

cW Create an `amend!` (`--fixup=reword:`) commit for
the commit under the cursor.

cF Create a `fixup!` commit for the commit under the
cursor and immediately rebase it.

Expand All @@ -487,7 +493,7 @@ cs Create a `squash!` commit for the commit under the
cS Create a `squash!` commit for the commit under the
cursor and immediately rebase it.

cA Create a `squash!` commit for the commit under the
cn Create a `squash!` commit for the commit under the
cursor and edit the message.

c<Space> Populate command line with ":Git commit ".
Expand Down