diff --git a/git.scmbrc.example b/git.scmbrc.example index e5e2aa0..287bfaa 100644 --- a/git.scmbrc.example +++ b/git.scmbrc.example @@ -113,9 +113,10 @@ git_pull_request_alias="gpr" # ---------------------------------------------- # Keyboard shortcuts are on by default. Set this to 'false' to disable them. git_keyboard_shortcuts_enabled="true" -git_commit_all_keys="\C-x " # CTRL+x, SPACE -git_add_and_commit_keys="\C-xc" # CTRL+x, c -git_commit_all_with_ci_skip_keys="\C-xv" # CTRL+x, v (Appends [ci skip] to commit message) +git_commit_all_keys="\C-x " # CTRL+x, SPACE +git_add_and_commit_keys="\C-xc" # CTRL+x, c +git_commit_all_with_ci_skip_keys="\C-xv" # CTRL+x, v (Appends [ci skip] to message) +git_add_and_amend_commit_keys="\C-xz" # CTRL+x, z # Shell Command Wrapping diff --git a/lib/git/keybindings.sh b/lib/git/keybindings.sh index dc9f186..4bbca42 100644 --- a/lib/git/keybindings.sh +++ b/lib/git/keybindings.sh @@ -36,10 +36,12 @@ if [[ "$git_keyboard_shortcuts_enabled" = "true" ]]; then _bind "$git_commit_all_keys" " git_commit_all""$RETURN_CHAR" _bind "$git_add_and_commit_keys" " \033[1~ git_add_and_commit ""$RETURN_CHAR" _bind "$git_commit_all_with_ci_skip_keys" " \033[1~ GIT_COMMIT_MSG_SUFFIX='[ci skip]' git_commit_all ""$RETURN_CHAR" + _bind "$git_add_and_amend_commit_keys" " git add --all . && git commit --amend -C HEAD""$RETURN_CHAR" else _bind "$git_commit_all_keys" "\" git_commit_all$RETURN_CHAR\"" _bind "$git_add_and_commit_keys" "\"\C-A git_add_and_commit $RETURN_CHAR\"" _bind "$git_commit_all_with_ci_skip_keys" "\"\C-A GIT_COMMIT_MSG_SUFFIX='[ci skip]' git_commit_all $RETURN_CHAR\"" + _bind "$git_add_and_amend_commit_keys" "\" git add --all . && git commit --amend -C HEAD$RETURN_CHAR\"" fi fi