@@ -9,42 +9,33 @@
99
1010> NOTE: Unlike vim, `f`, `F`, `t` and `T` are not confined to the current line.
1111
12−| Key | Description | Command |
13−| ----- | ----------- | ------- |
14−| `h`/`Left` | Move left | `move_char_left` |
15−| `j`/`Down` | Move down | `move_line_down` |
16−| `k`/`Up` | Move up | `move_line_up` |
17−| `l`/`Right` | Move right | `move_char_right` |
18−| `w` | Move next word start | `move_next_word_start` |
19−| `b` | Move previous word start | `move_prev_word_start` |
20−| `e` | Move next word end | `move_next_word_end` |
21−| `W` | Move next WORD start | `move_next_long_word_start` |
22−| `B` | Move previous WORD start | `move_prev_long_word_start` |
23−| `E` | Move next WORD end | `move_next_long_word_end` |
24−| `t` | Find 'till next char | `find_till_char` |
25−| `f` | Find next char | `find_next_char` |
26−| `T` | Find 'till previous char | `till_prev_char` |
27−| `F` | Find previous char | `find_prev_char` |
28−| `G` | Go to line number `<n>` | `goto_line` |
29−| `Alt-.` | Repeat last motion (`f`, `t` or `m`) | `repeat_last_motion` |
30−| `Alt-:` | Ensures the selection is in forward direction | `ensure_selections_forward` |
31−| `Home` | Move to the start of the line | `goto_line_start` |
32−| `End` | Move to the end of the line | `goto_line_end` |
33−| `PageUp` | Move page up | `page_up` |
34−| `PageDown` | Move page down | `page_down` |
35−| `Ctrl-u` | Move half page up | `half_page_up` |
36−| `Ctrl-d` | Move half page down | `half_page_down` |
37−| `Ctrl-i` | Jump forward on the jumplist | `jump_forward` |
38−| `Ctrl-o` | Jump backward on the jumplist | `jump_backward` |
39−| `Ctrl-s` | Save the current selection to the jumplist | `save_selection` |
40−| `v` | Enter [select (extend) mode](#select--extend-mode) | `select_mode` |
41−| `g` | Enter [goto mode](#goto-mode) | N/A |
42−| `m` | Enter [match mode](#match-mode) | N/A |
43−| `:` | Enter command mode | `command_mode` |
44−| `z` | Enter [view mode](#view-mode) | N/A |
45−| `Z` | Enter sticky [view mode](#view-mode) | N/A |
46−| `Ctrl-w` | Enter [window mode](#window-mode) | N/A |
47−| `Space` | Enter [space mode](#space-mode) | N/A |
12+| Key | Description | Command |
13+| ----- | ----------- | ------- |
14+| `h`, `Left` | Move left | `move_char_left` |
15+| `j`, `Down` | Move down | `move_line_down` |
16+| `k`, `Up` | Move up | `move_line_up` |
17+| `l`, `Right` | Move right | `move_char_right` |
18+| `w` | Move next word start | `move_next_word_start` |
19+| `b` | Move previous word start | `move_prev_word_start` |
20+| `e` | Move next word end | `move_next_word_end` |
21+| `W` | Move next WORD start | `move_next_long_word_start` |
22+| `B` | Move previous WORD start | `move_prev_long_word_start` |
23+| `E` | Move next WORD end | `move_next_long_word_end` |
24+| `t` | Find 'till next char | `find_till_char` |
25+| `f` | Find next char | `find_next_char` |
26+| `T` | Find 'till previous char | `till_prev_char` |
27+| `F` | Find previous char | `find_prev_char` |
28+| `G` | Go to line number `<n>` | `goto_line` |
29+| `Alt-.` | Repeat last motion (`f`, `t` or `m`) | `repeat_last_motion` |
30+| `Home` | Move to the start of the line | `goto_line_start` |
31+| `End` | Move to the end of the line | `goto_line_end` |
32+| `Ctrl-b`, `PageUp` | Move page up | `page_up` |
33+| `Ctrl-f`, `PageDown` | Move page down | `page_down` |
34+| `Ctrl-u` | Move half page up | `half_page_up` |
35+| `Ctrl-d` | Move half page down | `half_page_down` |
36+| `Ctrl-i` | Jump forward on the jumplist | `jump_forward` |
37+| `Ctrl-o` | Jump backward on the jumplist | `jump_backward` |
38+| `Ctrl-s` | Save the current selection to the jumplist | `save_selection` |
4839
4940### Changes
5041
@@ -84,48 +75,50 @@
8475
8576#### Shell
8677
87−| Key | Description | Command |
88−| ------ | ----------- | ------- |
89−| <code>|</code> | Pipe each selection through shell command, replacing with output | `shell_pipe` |
90−| <code>Alt-|</code> | Pipe each selection into shell command, ignoring output | `shell_pipe_to` |
91−| `!` | Run shell command, inserting output before each selection | `shell_insert_output` |
92−| `Alt-!` | Run shell command, appending output after each selection | `shell_append_output` |
78+| Key | Description | Command |
79+| ------ | ----------- | ------- |
80+| `|` | Pipe each selection through shell command, replacing with output | `shell_pipe` |
81+| `Alt-|` | Pipe each selection into shell command, ignoring output | `shell_pipe_to` |
82+| `!` | Run shell command, inserting output before each selection | `shell_insert_output` |
83+| `Alt-!` | Run shell command, appending output after each selection | `shell_append_output` |
9384| `$` | Pipe each selection into shell command, keep selections where command returned 0 | `shell_keep_pipe` |
9485
9586
9687### Selection manipulation
9788
98−| Key | Description | Command |
99−| ----- | ----------- | ------- |
100−| `s` | Select all regex matches inside selections | `select_regex` |
101−| `S` | Split selection into subselections on regex matches | `split_selection` |
102−| `Alt-s` | Split selection on newlines | `split_selection_on_newline` |
103−| `&` | Align selection in columns | `align_selections` |
104−| `_` | Trim whitespace from the selection | `trim_selections` |
105−| `;` | Collapse selection onto a single cursor | `collapse_selection` |
106−| `Alt-;` | Flip selection cursor and anchor | `flip_selections` |
107−| `,` | Keep only the primary selection | `keep_primary_selection` |
108−| `Alt-,` | Remove the primary selection | `remove_primary_selection` |
109−| `C` | Copy selection onto the next line (Add cursor below) | `copy_selection_on_next_line` |
110−| `Alt-C` | Copy selection onto the previous line (Add cursor above) | `copy_selection_on_prev_line` |
111−| `(` | Rotate main selection backward | `rotate_selections_backward` |
112−| `)` | Rotate main selection forward | `rotate_selections_forward` |
113−| `Alt-(` | Rotate selection contents backward | `rotate_selection_contents_backward` |
114−| `Alt-)` | Rotate selection contents forward | `rotate_selection_contents_forward` |
115−| `%` | Select entire file | `select_all` |
116−| `x` | Select current line, if already selected, extend to next line | `extend_line` |
117−| `X` | Extend selection to line bounds (line-wise selection) | `extend_to_line_bounds` |
118−| `J` | Join lines inside selection | `join_selections` |
119−| `K` | Keep selections matching the regex | `keep_selections` |
120−| `Alt-K` | Remove selections matching the regex | `remove_selections` |
121−| `Ctrl-c` | Comment/uncomment the selections | `toggle_comments` |
122−| `Alt-k`/`Alt-up` | Expand selection to parent syntax node (**TS**) | `expand_selection` |
123−| `Alt-j`/`Alt-down` | Shrink syntax tree object selection (**TS**) | `shrink_selection` |
124−| `Alt-h`/`Alt-left` | Select previous sibling node in syntax tree (**TS**) | `select_prev_sibling` |
125−| `Alt-l`/`Alt-right` | Select next sibling node in syntax tree (**TS**) | `select_next_sibling` |
89+| Key | Description | Command |
90+| ----- | ----------- | ------- |
91+| `s` | Select all regex matches inside selections | `select_regex` |
92+| `S` | Split selection into subselections on regex matches | `split_selection` |
93+| `Alt-s` | Split selection on newlines | `split_selection_on_newline` |
94+| `&` | Align selection in columns | `align_selections` |
95+| `_` | Trim whitespace from the selection | `trim_selections` |
96+| `;` | Collapse selection onto a single cursor | `collapse_selection` |
97+| `Alt-;` | Flip selection cursor and anchor | `flip_selections` |
98+| `Alt-:` | Ensures the selection is in forward direction | `ensure_selections_forward` |
99+| `,` | Keep only the primary selection | `keep_primary_selection` |
100+| `Alt-,` | Remove the primary selection | `remove_primary_selection` |
101+| `C` | Copy selection onto the next line (Add cursor below) | `copy_selection_on_next_line` |
102+| `Alt-C` | Copy selection onto the previous line (Add cursor above) | `copy_selection_on_prev_line` |
103+| `(` | Rotate main selection backward | `rotate_selections_backward` |
104+| `)` | Rotate main selection forward | `rotate_selections_forward` |
105+| `Alt-(` | Rotate selection contents backward | `rotate_selection_contents_backward` |
106+| `Alt-)` | Rotate selection contents forward | `rotate_selection_contents_forward` |
107+| `%` | Select entire file | `select_all` |
108+| `x` | Select current line, if already selected, extend to next line | `extend_line` |
109+| `X` | Extend selection to line bounds (line-wise selection) | `extend_to_line_bounds` |
110+| `J` | Join lines inside selection | `join_selections` |
111+| `K` | Keep selections matching the regex | `keep_selections` |
112+| `Alt-K` | Remove selections matching the regex | `remove_selections` |
113+| `Ctrl-c` | Comment/uncomment the selections | `toggle_comments` |
114+| `Alt-k`, `Alt-up` | Expand selection to parent syntax node (**TS**) | `expand_selection` |
115+| `Alt-j`, `Alt-down` | Shrink syntax tree object selection (**TS**) | `shrink_selection` |
116+| `Alt-h`, `Alt-left` | Select previous sibling node in syntax tree (**TS**) | `select_prev_sibling` |
117+| `Alt-l`, `Alt-right` | Select next sibling node in syntax tree (**TS**) | `select_next_sibling` |
126118
127119### Search
128120
121+Search commands all operate on the `/` register by default. Use `"<char>` to operate on a different one.
129122
130123| Key | Description | Command |
131124| ----- | ----------- | ------- |
@@ -139,6 +132,17 @@
139132
140133These sub-modes are accessible from normal mode and typically switch back to normal mode after a command.
141134
135+| Key | Description | Command |
136+| ----- | ----------- | ------- |
137+| `v` | Enter [select (extend) mode](#select--extend-mode) | `select_mode` |
138+| `g` | Enter [goto mode](#goto-mode) | N/A |
139+| `m` | Enter [match mode](#match-mode) | N/A |
140+| `:` | Enter command mode | `command_mode` |
141+| `z` | Enter [view mode](#view-mode) | N/A |
142+| `Z` | Enter sticky [view mode](#view-mode) | N/A |
143+| `Ctrl-w` | Enter [window mode](#window-mode) | N/A |
144+| `Space` | Enter [space mode](#space-mode) | N/A |
145+
142146#### View mode
143147
144148View mode is intended for scrolling and manipulating the view without changing
@@ -147,18 +151,18 @@ key to return to normal mode after usage (useful when you're simply looking
147151over text and not actively editing it).
148152
149153
150−| Key | Description | Command |
151−| ----- | ----------- | ------- |
152−| `z` , `c` | Vertically center the line | `align_view_center` |
153−| `t` | Align the line to the top of the screen | `align_view_top` |
154−| `b` | Align the line to the bottom of the screen | `align_view_bottom` |
155−| `m` | Align the line to the middle of the screen (horizontally) | `align_view_middle` |
156−| `j` , `down` | Scroll the view downwards | `scroll_down` |
157−| `k` , `up` | Scroll the view upwards | `scroll_up` |
158−| `Ctrl-f` | Move page down | `page_down` |
159−| `Ctrl-b` | Move page up | `page_up` |
160−| `Ctrl-d` | Move half page down | `half_page_down` |
161−| `Ctrl-u` | Move half page up | `half_page_up` |
154+| Key | Description | Command |
155+| ----- | ----------- | ------- |
156+| `z`, `c` | Vertically center the line | `align_view_center` |
157+| `t` | Align the line to the top of the screen | `align_view_top` |
158+| `b` | Align the line to the bottom of the screen | `align_view_bottom` |
159+| `m` | Align the line to the middle of the screen (horizontally) | `align_view_middle` |
160+| `j`, `down` | Scroll the view downwards | `scroll_down` |
161+| `k`, `up` | Scroll the view upwards | `scroll_up` |
162+| `Ctrl-f`, `PageDown` | Move page down | `page_down` |
163+| `Ctrl-b`, `PageUp` | Move page up | `page_up` |
164+| `Ctrl-d` | Move half page down | `half_page_down` |
165+| `Ctrl-u` | Move half page up | `half_page_up` |
162166
163167#### Goto mode
164168
@@ -206,19 +210,19 @@ TODO: Mappings for selecting syntax nodes (a superset of `[`).
206210
207211This layer is similar to vim keybindings as kakoune does not support window.
208212
209−| Key | Description | Command |
210−| ----- | ------------- | ------- |
211−| `w`, `Ctrl-w` | Switch to next window | `rotate_view` |
212−| `v`, `Ctrl-v` | Vertical right split | `vsplit` |
213−| `s`, `Ctrl-s` | Horizontal bottom split | `hsplit` |
214−| `h`, `Ctrl-h`, `left` | Move to left split | `jump_view_left` |
215−| `f` | Go to files in the selection in horizontal splits | `goto_file` |
216−| `F` | Go to files in the selection in vertical splits | `goto_file` |
217−| `j`, `Ctrl-j`, `down` | Move to split below | `jump_view_down` |
218−| `k`, `Ctrl-k`, `up` | Move to split above | `jump_view_up` |
219−| `l`, `Ctrl-l`, `right` | Move to right split | `jump_view_right` |
220−| `q`, `Ctrl-q` | Close current window | `wclose` |
221−| `o`, `Ctrl-o` | Only keep the current window, closing all the others | `wonly` |
213+| Key | Description | Command |
214+| ----- | ------------- | ------- |
215+| `w`, `Ctrl-w` | Switch to next window | `rotate_view` |
216+| `v`, `Ctrl-v` | Vertical right split | `vsplit` |
217+| `s`, `Ctrl-s` | Horizontal bottom split | `hsplit` |
218+| `f` | Go to files in the selection in horizontal splits | `goto_file` |
219+| `F` | Go to files in the selection in vertical splits | `goto_file` |
220+| `h`, `Ctrl-h`, `Left` | Move to left split | `jump_view_left` |
221+| `j`, `Ctrl-j`, `Down` | Move to split below | `jump_view_down` |
222+| `k`, `Ctrl-k`, `Up` | Move to split above | `jump_view_up` |
223+| `l`, `Ctrl-l`, `Right` | Move to right split | `jump_view_right` |
224+| `q`, `Ctrl-q` | Close current window | `wclose` |
225+| `o`, `Ctrl-o` | Only keep the current window, closing all the others | `wonly` |
222226
223227#### Space mode
224228
@@ -242,6 +246,7 @@ This layer is a kludge of mappings, mostly pickers.
242246| `Y` | Yank main selection to clipboard | `yank_main_selection_to_clipboard` |
243247| `R` | Replace selections by clipboard contents | `replace_selections_with_clipboard` |
244248| `/` | Global search in workspace folder | `global_search` |
249+| `?` | Open command palette | `command_palette` |
245250
246251> TIP: Global search displays results in a fuzzy picker, use `space + '` to bring it back up after opening a file.
247252
@@ -277,33 +282,48 @@ Mappings in the style of [vim-unimpaired](https://github.com/tpope/vim-unimpaire
277282
278283## Insert Mode
279284
280−| Key | Description | Command |
281−| ----- | ----------- | ------- |
282−| `Escape` | Switch to normal mode | `normal_mode` |
283−| `Ctrl-x` | Autocomplete | `completion` |
284−| `Ctrl-r` | Insert a register content | `insert_register` |
285−| `Ctrl-w` | Delete previous word | `delete_word_backward` |
286−| `Alt-d` | Delete next word | `delete_word_forward` |
287−| `Alt-b`, `Alt-Left` | Backward a word | `move_prev_word_end` |
288−| `Ctrl-b`, `Left` | Backward a char | `move_char_left` |
289−| `Alt-f`, `Alt-Right` | Forward a word | `move_next_word_start` |
290−| `Ctrl-f`, `Right` | Forward a char | `move_char_right` |
291−| `Ctrl-e`, `End` | move to line end | `goto_line_end_newline` |
292−| `Ctrl-a`, `Home` | move to line start | `goto_line_start` |
293−| `Ctrl-u` | delete to start of line | `kill_to_line_start` |
294−| `Ctrl-k` | delete to end of line | `kill_to_line_end` |
295−| `backspace`, `Ctrl-h` | delete previous char | `delete_char_backward` |
296−| `delete`, `Ctrl-d` | delete previous char | `delete_char_forward` |
297−| `Ctrl-p`, `Up` | move to previous line | `move_line_up` |
298−| `Ctrl-n`, `Down` | move to next line | `move_line_down` |
285+We support many readline/emacs style bindings in insert mode for
286+convenience. These can be helpful for making simple modifications
287+without escaping to normal mode, but beware that you will not have an
288+undo-able "save point" until you return to normal mode.
289+
290+| Key | Description | Command |
291+| ----- | ----------- | ------- |
292+| `Escape` | Switch to normal mode | `normal_mode` |
293+| `Ctrl-x` | Autocomplete | `completion` |
294+| `Ctrl-r` | Insert a register content | `insert_register` |
295+| `Ctrl-w`, `Alt-Backspace` | Delete previous word | `delete_word_backward` |
296+| `Alt-d` | Delete next word | `delete_word_forward` |
297+| `Alt-b`, `Alt-Left` | Backward a word | `move_prev_word_end` |
298+| `Ctrl-b`, `Left` | Backward a char | `move_char_left` |
299+| `Alt-f`, `Alt-Right` | Forward a word | `move_next_word_start` |
300+| `Ctrl-f`, `Right` | Forward a char | `move_char_right` |
301+| `Ctrl-e`, `End` | Move to line end | `goto_line_end_newline` |
302+| `Ctrl-a`, `Home` | Move to line start | `goto_line_start` |
303+| `Ctrl-u` | Delete to start of line | `kill_to_line_start` |
304+| `Ctrl-k` | Delete to end of line | `kill_to_line_end` |
305+| `Ctrl-j`, `Enter` | Insert new line | `insert_newline` |
306+| `Backspace`, `Ctrl-h` | Delete previous char | `delete_char_backward` |
307+| `Delete`, `Ctrl-d` | Delete previous char | `delete_char_forward` |
308+| `Ctrl-p`, `Up` | Move to previous line | `move_line_up` |
309+| `Ctrl-n`, `Down` | Move to next line | `move_line_down` |
310+| `PageUp` | Move one page up | `page_up` |
311+| `PageDown` | Move one page down | `page_down` |
312+| `Alt->` | Go to end of buffer | `goto_file_end` |
313+| `Alt-<` | Go to start of buffer | `goto_file_start` |
299314
300315## Select / extend mode
301316
302−I'm still pondering whether to keep this mode or not. It changes movement
303−commands (including goto) to extend the existing selection instead of replacing it.
317+This mode echoes Normal mode, but changes any movements to extend
318+selections rather than replace them. Goto motions are also changed to
319+extend, so that `vgl` for example extends the selection to the end of
320+the line.
304321
305−> NOTE: It's a bit confusing at the moment because extend hasn't been
306−> implemented for all movement commands yet.
322+Search is also affected. By default, `n` and `N` will remove the current
323+selection and select the next instance of the search term. Toggling this
324+mode before pressing `n` or `N` makes it possible to keep the current
325+selection. Toggling it on and off during your iterative searching allows
326+you to selectively add search terms to your selections.
307327
308328# Picker
309329