Added keyboard shortcut to add all changes to the previous commit (Ctrl+x, z)

This commit is contained in:
Nathan Broadbent
2018-09-26 23:13:31 +07:00
parent 8233abd23f
commit e5971cfdd5
2 changed files with 6 additions and 3 deletions

View File

@@ -115,7 +115,8 @@ git_pull_request_alias="gpr"
git_keyboard_shortcuts_enabled="true" git_keyboard_shortcuts_enabled="true"
git_commit_all_keys="\C-x " # CTRL+x, SPACE git_commit_all_keys="\C-x " # CTRL+x, SPACE
git_add_and_commit_keys="\C-xc" # CTRL+x, c 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_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 # Shell Command Wrapping

View File

@@ -36,10 +36,12 @@ if [[ "$git_keyboard_shortcuts_enabled" = "true" ]]; then
_bind "$git_commit_all_keys" " git_commit_all""$RETURN_CHAR" _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_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_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 else
_bind "$git_commit_all_keys" "\" git_commit_all$RETURN_CHAR\"" _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_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_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
fi fi