aboutsummaryrefslogtreecommitdiff
path: root/book/src/keymap.md
diff options
context:
space:
mode:
Diffstat (limited to 'book/src/keymap.md')
-rw-r--r--book/src/keymap.md145
1 files changed, 88 insertions, 57 deletions
diff --git a/book/src/keymap.md b/book/src/keymap.md
index 156b1d99..5a6aee41 100644
--- a/book/src/keymap.md
+++ b/book/src/keymap.md
@@ -6,38 +6,39 @@
> NOTE: Unlike vim, `f`, `F`, `t` and `T` are not confined to the current line.
-| Key | Description | Command |
-| ----- | ----------- | ------- |
-| `h`, `Left` | Move left | `move_char_left` |
-| `j`, `Down` | Move down | `move_char_right` |
-| `k`, `Up` | Move up | `move_line_up` |
-| `l`, `Right` | Move right | `move_line_down` |
-| `w` | Move next word start | `move_next_word_start` |
-| `b` | Move previous word start | `move_prev_word_start` |
-| `e` | Move next word end | `move_next_word_end` |
-| `W` | Move next WORD start | `move_next_long_word_start` |
-| `B` | Move previous WORD start | `move_prev_long_word_start` |
-| `E` | Move next WORD end | `move_next_long_word_end` |
-| `t` | Find 'till next char | `find_till_char` |
-| `f` | Find next char | `find_next_char` |
-| `T` | Find 'till previous char | `till_prev_char` |
-| `F` | Find previous char | `find_prev_char` |
-| `Home` | Move to the start of the line | `goto_line_start` |
-| `End` | Move to the end of the line | `goto_line_end` |
-| `PageUp` | Move page up | `page_up` |
-| `PageDown` | Move page down | `page_down` |
-| `Ctrl-u` | Move half page up | `half_page_up` |
-| `Ctrl-d` | Move half page down | `half_page_down` |
-| `Ctrl-i` | Jump forward on the jumplist | `jump_forward` |
-| `Ctrl-o` | Jump backward on the jumplist | `jump_backward` |
-| `v` | Enter [select (extend) mode](#select--extend-mode) | `select_mode` |
-| `g` | Enter [goto mode](#goto-mode) | N/A |
-| `m` | Enter [match mode](#match-mode) | N/A |
-| `:` | Enter command mode | `command_mode` |
-| `z` | Enter [view mode](#view-mode) | N/A |
-| `Z` | Enter sticky [view mode](#view-mode) | N/A |
-| `Ctrl-w` | Enter [window mode](#window-mode) | N/A |
-| `Space` | Enter [space mode](#space-mode) | N/A |
+| Key | Description | Command |
+| ----- | ----------- | ------- |
+| `h`/`Left` | Move left | `move_char_left` |
+| `j`/`Down` | Move down | `move_line_down` |
+| `k`/`Up` | Move up | `move_line_up` |
+| `l`/`Right` | Move right | `move_char_right` |
+| `w` | Move next word start | `move_next_word_start` |
+| `b` | Move previous word start | `move_prev_word_start` |
+| `e` | Move next word end | `move_next_word_end` |
+| `W` | Move next WORD start | `move_next_long_word_start` |
+| `B` | Move previous WORD start | `move_prev_long_word_start` |
+| `E` | Move next WORD end | `move_next_long_word_end` |
+| `t` | Find 'till next char | `find_till_char` |
+| `f` | Find next char | `find_next_char` |
+| `T` | Find 'till previous char | `till_prev_char` |
+| `F` | Find previous char | `find_prev_char` |
+| `Alt-.` | Repeat last motion (`f`, `t` or `m`) | `repeat_last_motion` |
+| `Home` | Move to the start of the line | `goto_line_start` |
+| `End` | Move to the end of the line | `goto_line_end` |
+| `PageUp` | Move page up | `page_up` |
+| `PageDown` | Move page down | `page_down` |
+| `Ctrl-u` | Move half page up | `half_page_up` |
+| `Ctrl-d` | Move half page down | `half_page_down` |
+| `Ctrl-i` | Jump forward on the jumplist | `jump_forward` |
+| `Ctrl-o` | Jump backward on the jumplist | `jump_backward` |
+| `v` | Enter [select (extend) mode](#select--extend-mode) | `select_mode` |
+| `g` | Enter [goto mode](#goto-mode) | N/A |
+| `m` | Enter [match mode](#match-mode) | N/A |
+| `:` | Enter command mode | `command_mode` |
+| `z` | Enter [view mode](#view-mode) | N/A |
+| `Z` | Enter sticky [view mode](#view-mode) | N/A |
+| `Ctrl-w` | Enter [window mode](#window-mode) | N/A |
+| `Space` | Enter [space mode](#space-mode) | N/A |
### Changes
@@ -54,6 +55,7 @@
| `A` | Insert at the end of the line | `append_to_line` |
| `o` | Open new line below selection | `open_below` |
| `O` | Open new line above selection | `open_above` |
+| `.` | Repeat last change | N/A |
| `u` | Undo change | `undo` |
| `U` | Redo change | `redo` |
| `y` | Yank selection | `yank` |
@@ -86,8 +88,9 @@
| `;` | Collapse selection onto a single cursor | `collapse_selection` |
| `Alt-;` | Flip selection cursor and anchor | `flip_selections` |
| `,` | Keep only the primary selection | `keep_primary_selection` |
-| `C` | Copy selection onto the next line | `copy_selection_on_next_line` |
-| `Alt-C` | Copy selection onto the previous line | `copy_selection_on_prev_line` |
+| `Alt-,` | Remove the primary selection | `remove_primary_selection` |
+| `C` | Copy selection onto the next line (Add cursor below) | `copy_selection_on_next_line` |
+| `Alt-C` | Copy selection onto the previous line (Add cursor above) | `copy_selection_on_prev_line` |
| `(` | Rotate main selection backward | `rotate_selections_backward` |
| `)` | Rotate main selection forward | `rotate_selections_forward` |
| `Alt-(` | Rotate selection contents backward | `rotate_selection_contents_backward` |
@@ -103,13 +106,13 @@
### Search
-> TODO: The search implementation isn't ideal yet -- we don't support searching in reverse.
| Key | Description | Command |
| ----- | ----------- | ------- |
| `/` | Search for regex pattern | `search` |
+| `?` | Search for previous pattern | `rsearch` |
| `n` | Select next search match | `search_next` |
-| `N` | Add next search match to selection | `extend_search_next` |
+| `N` | Select previous search match | `search_prev` |
| `*` | Use current selection as the search pattern | `search_selection` |
### Minor modes
@@ -158,6 +161,8 @@ Jumps to various locations.
| `r` | Go to references | `goto_reference` |
| `i` | Go to implementation | `goto_implementation` |
| `a` | Go to the last accessed/alternate file | `goto_last_accessed_file` |
+| `n` | Go to next buffer | `goto_next_buffer` |
+| `p` | Go to previous buffer | `goto_previous_buffer` |
#### Match mode
@@ -180,12 +185,16 @@ TODO: Mappings for selecting syntax nodes (a superset of `[`).
This layer is similar to vim keybindings as kakoune does not support window.
-| Key | Description | Command |
-| ----- | ------------- | ------- |
-| `w`, `Ctrl-w` | Switch to next window | `rotate_view` |
-| `v`, `Ctrl-v` | Vertical right split | `vsplit` |
-| `h`, `Ctrl-h` | Horizontal bottom split | `hsplit` |
-| `q`, `Ctrl-q` | Close current window | `wclose` |
+| Key | Description | Command |
+| ----- | ------------- | ------- |
+| `w`, `Ctrl-w` | Switch to next window | `rotate_view` |
+| `v`, `Ctrl-v` | Vertical right split | `vsplit` |
+| `s`, `Ctrl-s` | Horizontal bottom split | `hsplit` |
+| `h`, `Ctrl-h`, `left` | Move to left split | `jump_view_left` |
+| `j`, `Ctrl-j`, `down` | Move to split below | `jump_view_down` |
+| `k`, `Ctrl-k`, `up` | Move to split above | `jump_view_up` |
+| `l`, `Ctrl-l`, `right` | Move to right split | `jump_view_right` |
+| `q`, `Ctrl-q` | Close current window | `wclose` |
#### Space mode
@@ -213,12 +222,12 @@ This layer is a kludge of mappings, mostly pickers.
Mappings in the style of [vim-unimpaired](https://github.com/tpope/vim-unimpaired).
-| Key | Description | Command |
-| ----- | ----------- | ------- |
-| `[d` | Go to previous diagnostic | `goto_prev_diag` |
-| `]d` | Go to next diagnostic | `goto_next_diag` |
-| `[D` | Go to first diagnostic in document | `goto_first_diag` |
-| `]D` | Go to last diagnostic in document | `goto_last_diag` |
+| Key | Description | Command |
+| ----- | ----------- | ------- |
+| `[d` | Go to previous diagnostic | `goto_prev_diag` |
+| `]d` | Go to next diagnostic | `goto_next_diag` |
+| `[D` | Go to first diagnostic in document | `goto_first_diag` |
+| `]D` | Go to last diagnostic in document | `goto_last_diag` |
| `[space` | Add newline above | `add_newline_above` |
| `]space` | Add newline below | `add_newline_below` |
@@ -242,12 +251,34 @@ commands (including goto) to extend the existing selection instead of replacing
Keys to use within picker. Remapping currently not supported.
-| Key | Description |
-| ----- | ------------- |
-| `Up`, `Ctrl-p` | Previous entry |
-| `Down`, `Ctrl-n` | Next entry |
-| `Ctrl-space` | Filter options |
-| `Enter` | Open selected |
-| `Ctrl-h` | Open horizontally |
-| `Ctrl-v` | Open vertically |
-| `Escape`, `Ctrl-c` | Close picker |
+| Key | Description |
+| ----- | ------------- |
+| `Up`, `Ctrl-k`, `Ctrl-p` | Previous entry |
+| `Down`, `Ctrl-j`, `Ctrl-n` | Next entry |
+| `Ctrl-space` | Filter options |
+| `Enter` | Open selected |
+| `Ctrl-s` | Open horizontally |
+| `Ctrl-v` | Open vertically |
+| `Escape`, `Ctrl-c` | Close picker |
+
+# Prompt
+Keys to use within prompt, Remapping currently not supported.
+| Key | Description |
+| ----- | ------------- |
+| `Escape`, `Ctrl-c` | Close prompt |
+| `Alt-b`, `Alt-Left` | Backward a word |
+| `Ctrl-b`, `Left` | Backward a char |
+| `Alt-f`, `Alt-Right` | Forward a word |
+| `Ctrl-f`, `Right` | Forward a char |
+| `Ctrl-e`, `End` | move prompt end |
+| `Ctrl-a`, `Home` | move prompt start |
+| `Ctrl-w` | delete previous word |
+| `Ctrl-k` | delete to end of line |
+| `backspace` | delete previous char |
+| `Ctrl-s` | insert a word under doc cursor, may be changed to Ctrl-r Ctrl-w later |
+| `Ctrl-p`, `Up` | select previous history |
+| `Ctrl-n`, `Down` | select next history |
+| `Tab` | slect next completion item |
+| `BackTab` | slect previous completion item |
+| `Enter` | Open selected |
+