git layer: add key bindings in rebase mode and document them
This commit is contained in:
parent
83f268e04b
commit
790a5cc5e9
|
@ -17,6 +17,8 @@
|
||||||
- [Git](#git)
|
- [Git](#git)
|
||||||
- [Working with Git](#working-with-git)
|
- [Working with Git](#working-with-git)
|
||||||
- [Magit](#magit)
|
- [Magit](#magit)
|
||||||
|
- [Commit message edition buffer](#commit-message-edition-buffer)
|
||||||
|
- [Interactive rebase buffer](#interactive-rebase-buffer)
|
||||||
- [Quick guide for recurring use cases in Magit](#quick-guide-for-recurring-use-cases-in-magit)
|
- [Quick guide for recurring use cases in Magit](#quick-guide-for-recurring-use-cases-in-magit)
|
||||||
- [Git time machine](#git-time-machine)
|
- [Git time machine](#git-time-machine)
|
||||||
- [Git gutter](#git-gutter)
|
- [Git gutter](#git-gutter)
|
||||||
|
@ -191,11 +193,43 @@ Here are the often used bindings inside a `status buffer`:
|
||||||
<kbd>C-v</kbd> | revert item at point
|
<kbd>C-v</kbd> | revert item at point
|
||||||
<kbd>z z</kbd> | stash changes
|
<kbd>z z</kbd> | stash changes
|
||||||
|
|
||||||
In a commit message buffer press `C-c C-c` to commit the changes with the
|
### Commit message edition buffer
|
||||||
entered message. `C-c C-k` will discard the commit message.
|
|
||||||
|
|
||||||
**Note:** Sometimes you will be asked about reverting the commit buffer,
|
In a commit message buffer press <kbd>C-c C-c</kbd> or <kbd>SPC m c c</kbd>
|
||||||
you can answer `y` with no issue.
|
to commit the changes with the entered message.
|
||||||
|
Pressing <kbd>C-c C-k</kbd> or <kbd>SPC m k</kbd> will discard the commit
|
||||||
|
message.
|
||||||
|
|
||||||
|
Key Binding | Description
|
||||||
|
----------------------|--------------------------------------------------------
|
||||||
|
<kbd>h</kbd> | go left
|
||||||
|
<kbd>j</kbd> | go down
|
||||||
|
<kbd>k</kbd> | go up
|
||||||
|
<kbd>l</kbd> | go right
|
||||||
|
<kbd>SPC m c c</kbd> | commit
|
||||||
|
<kbd>SPC m k</kbd> | abort
|
||||||
|
|
||||||
|
### Interactive rebase buffer
|
||||||
|
|
||||||
|
Key Binding | Description
|
||||||
|
----------------------|--------------------------------------------------------
|
||||||
|
<kbd>c</kbd> | pick
|
||||||
|
<kbd>e</kbd> | edit
|
||||||
|
<kbd>f</kbd> | fixup
|
||||||
|
<kbd>h</kbd> | go left
|
||||||
|
<kbd>j</kbd> | go down
|
||||||
|
<kbd>J</kbd> | move line down
|
||||||
|
<kbd>k</kbd> | go up
|
||||||
|
<kbd>K</kbd> | move line up
|
||||||
|
<kbd>C-k</kbd> | kill line
|
||||||
|
<kbd>l</kbd> | go right
|
||||||
|
<kbd>r</kbd> | reword
|
||||||
|
<kbd>s</kbd> | squash
|
||||||
|
<kbd>u</kbd> | undo
|
||||||
|
<kbd>x</kbd> | execute
|
||||||
|
<kbd>y</kbd> | insert
|
||||||
|
<kbd>SPC m c c</kbd> | rebase
|
||||||
|
<kbd>SPC m k</kbd> | abort
|
||||||
|
|
||||||
### Quick guide for recurring use cases in Magit
|
### Quick guide for recurring use cases in Magit
|
||||||
|
|
||||||
|
|
|
@ -139,8 +139,16 @@ which require an initialization must be listed explicitly in the list.")
|
||||||
(defun git/init-git-rebase-mode ()
|
(defun git/init-git-rebase-mode ()
|
||||||
(use-package git-rebase-mode
|
(use-package git-rebase-mode
|
||||||
:defer t
|
:defer t
|
||||||
:init (evilify git-rebase-mode git-rebase-mode-map
|
:config
|
||||||
"y" 'git-rebase-insert)))
|
(progn
|
||||||
|
(evilify git-rebase-mode git-rebase-mode-map
|
||||||
|
"J" 'git-rebase-move-line-down
|
||||||
|
"K" 'git-rebase-move-line-up
|
||||||
|
"u" 'git-rebase-undo
|
||||||
|
"y" 'git-rebase-insert)
|
||||||
|
(evil-leader/set-key-for-mode 'git-rebase-mode
|
||||||
|
"mcc" 'git-rebase-server-edit
|
||||||
|
"mk" 'git-rebase-abort))))
|
||||||
|
|
||||||
(defun git/init-git-timemachine ()
|
(defun git/init-git-timemachine ()
|
||||||
(use-package git-timemachine
|
(use-package git-timemachine
|
||||||
|
|
Loading…
Reference in a new issue