From 616988560a9282f07714e5057d24c62ad28f212d Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Wed, 28 Dec 2022 13:55:08 +0100 Subject: [PATCH] vim:keys: Add mapping for commit amending Map `gca` to fugitives `G commit --amend`, as I use that quite often. Also change the normal commit mapping to use double `c`s for unambiguity between the mappings and as I already got the habit of pressing `c` twice to skip waiting `timeoutlen` (As the mapping was already ambiguous with `gcd` for `:Gcd`). --- .config/vim/vimrc.d/40-keys.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.config/vim/vimrc.d/40-keys.vim b/.config/vim/vimrc.d/40-keys.vim index fefb49e..5554178 100644 --- a/.config/vim/vimrc.d/40-keys.vim +++ b/.config/vim/vimrc.d/40-keys.vim @@ -119,8 +119,10 @@ nmap gu :!git checkout -- % if exists('g:loaded_fugitive') " Interactive `git status` nmap gg :G - " Using fugitive.vim, start a commit and open the message in a new split - nmap gc :G commit + " Start a commit and open the message in a split + nmap gcc :G commit + " Amend the current commit and open the message in a split + nmap gca :G commit --amend " Move to root of directory nmap gcd :Gcd " git blame in scroll bound vertical split (only the commit hashes, see