3- Mappings marked (**LSP**) require an active language server for the file.
4- Mappings marked (**TS**) require a tree-sitter grammar for the filetype.
10> NOTE: Unlike vim, `f`, `F`, `t` and `T` are not confined to the current line.
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| `PageUp` | Move page up | `page_up` |
33| `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` |
39| `v` | Enter [select (extend) mode](#select--extend-mode) | `select_mode` |
40| `g` | Enter [goto mode](#goto-mode) | N/A |
41| `m` | Enter [match mode](#match-mode) | N/A |
42| `:` | Enter command mode | `command_mode` |
43| `z` | Enter [view mode](#view-mode) | N/A |
44| `Z` | Enter sticky [view mode](#view-mode) | N/A |
45| `Ctrl-w` | Enter [window mode](#window-mode) | N/A |
46| `Space` | Enter [space mode](#space-mode) | N/A |
50| Key | Description | Command |
51| ----- | ----------- | ------- |
52| `r` | Replace with a character | `replace` |
53| `R` | Replace with yanked text | `replace_with_yanked` |
54| `~` | Switch case of the selected text | `switch_case` |
55| `` ` `` | Set the selected text to lower case | `switch_to_lowercase` |
56| `` Alt-` `` | Set the selected text to upper case | `switch_to_uppercase` |
57| `i` | Insert before selection | `insert_mode` |
58| `a` | Insert after selection (append) | `append_mode` |
59| `I` | Insert at the start of the line | `prepend_to_line` |
60| `A` | Insert at the end of the line | `append_to_line` |
61| `o` | Open new line below selection | `open_below` |
62| `O` | Open new line above selection | `open_above` |
63| `.` | Repeat last change | N/A |
64| `u` | Undo change | `undo` |
65| `U` | Redo change | `redo` |
66| `Alt-u` | Move backward in history | `earlier` |
67| `Alt-U` | Move forward in history | `later` |
68| `y` | Yank selection | `yank` |
69| `p` | Paste after selection | `paste_after` |
70| `P` | Paste before selection | `paste_before` |
71| `"` `<reg>` | Select a register to yank to or paste from | `select_register` |
72| `>` | Indent selection | `indent` |
73| `<` | Unindent selection | `unindent` |
74| `=` | Format selection (currently nonfunctional/disabled) (**LSP**) | `format_selections` |
75| `d` | Delete selection | `delete_selection` |
76| `Alt-d` | Delete selection, without yanking | `delete_selection_noyank` |
77| `c` | Change selection (delete and enter insert mode) | `change_selection` |
78| `Alt-c` | Change selection (delete and enter insert mode, without yanking) | `change_selection_noyank` |
79| `Ctrl-a` | Increment object (number) under cursor | `increment` |
80| `Ctrl-x` | Decrement object (number) under cursor | `decrement` |
81| `Q` | Start/stop macro recording to the selected register (experimental) | `record_macro` |
82| `q` | Play back a recorded macro from the selected register (experimental) | `replay_macro` |
86| Key | Description | Command |
87| ------ | ----------- | ------- |
88| <code>|</code> | Pipe each selection through shell command, replacing with output | `shell_pipe` |
89| <code>Alt-|</code> | Pipe each selection into shell command, ignoring output | `shell_pipe_to` |
90| `!` | Run shell command, inserting output before each selection | `shell_insert_output` |
91| `Alt-!` | Run shell command, appending output after each selection | `shell_append_output` |
94### Selection manipulation
96| Key | Description | Command |
97| ----- | ----------- | ------- |
98| `s` | Select all regex matches inside selections | `select_regex` |
99| `S` | Split selection into subselections on regex matches | `split_selection` |
100| `Alt-s` | Split selection on newlines | `split_selection_on_newline` |
101| `&` | Align selection in columns | `align_selections` |
102| `_` | Trim whitespace from the selection | `trim_selections` |
103| `;` | Collapse selection onto a single cursor | `collapse_selection` |
104| `Alt-;` | Flip selection cursor and anchor | `flip_selections` |
105| `,` | Keep only the primary selection | `keep_primary_selection` |
106| `Alt-,` | Remove the primary selection | `remove_primary_selection` |
107| `C` | Copy selection onto the next line (Add cursor below) | `copy_selection_on_next_line` |
108| `Alt-C` | Copy selection onto the previous line (Add cursor above) | `copy_selection_on_prev_line` |
109| `(` | Rotate main selection backward | `rotate_selections_backward` |
110| `)` | Rotate main selection forward | `rotate_selections_forward` |
111| `Alt-(` | Rotate selection contents backward | `rotate_selection_contents_backward` |
112| `Alt-)` | Rotate selection contents forward | `rotate_selection_contents_forward` |
113| `%` | Select entire file | `select_all` |
114| `x` | Select current line, if already selected, extend to next line | `extend_line` |
115| `X` | Extend selection to line bounds (line-wise selection) | `extend_to_line_bounds` |
116| | Expand selection to parent syntax node TODO: pick a key (**TS**) | `expand_selection` |
117| `J` | Join lines inside selection | `join_selections` |
118| `K` | Keep selections matching the regex | `keep_selections` |
119| `Alt-K` | Remove selections matching the regex | `remove_selections` |
120| `$` | Pipe each selection into shell command, keep selections where command returned 0 | `shell_keep_pipe` |
121| `Ctrl-c` | Comment/uncomment the selections | `toggle_comments` |
122| `Alt-k` | Expand selection to parent syntax node | `expand_selection` |
123| `Alt-j` | Shrink syntax tree object selection | `shrink_selection` |
124| `Alt-h` | Select previous sibling node in syntax tree | `select_prev_sibling` |
125| `Alt-l` | Select next sibling node in syntax tree | `select_next_sibling` |
130| Key | Description | Command |
131| ----- | ----------- | ------- |
132| `/` | Search for regex pattern | `search` |
133| `?` | Search for previous pattern | `rsearch` |
134| `n` | Select next search match | `search_next` |
135| `N` | Select previous search match | `search_prev` |
136| `*` | Use current selection as the search pattern | `search_selection` |
140These sub-modes are accessible from normal mode and typically switch back to normal mode after a command.
144View mode is intended for scrolling and manipulating the view without changing
145the selection. The "sticky" variant of this mode is persistent; use the Escape
146key to return to normal mode after usage (useful when you're simply looking
147over text and not actively editing it).
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| `f` | Move page down | `page_down` |
159| `b` | Move page up | `page_up` |
160| `d` | Move half page down | `half_page_down` |
161| `u` | Move half page up | `half_page_up` |
165Jumps to various locations.
167| Key | Description | Command |
168| ----- | ----------- | ------- |
169| `g` | Go to line number `<n>` else start of file | `goto_file_start` |
170| `e` | Go to the end of the file | `goto_last_line` |
171| `f` | Go to files in the selection | `goto_file` |
172| `h` | Go to the start of the line | `goto_line_start` |
173| `l` | Go to the end of the line | `goto_line_end` |
174| `s` | Go to first non-whitespace character of the line | `goto_first_nonwhitespace` |
175| `t` | Go to the top of the screen | `goto_window_top` |
176| `c` | Go to the middle of the screen | `goto_window_center` |
177| `b` | Go to the bottom of the screen | `goto_window_bottom` |
178| `d` | Go to definition (**LSP**) | `goto_definition` |
179| `y` | Go to type definition (**LSP**) | `goto_type_definition` |
180| `r` | Go to references (**LSP**) | `goto_reference` |
181| `i` | Go to implementation (**LSP**) | `goto_implementation` |
182| `a` | Go to the last accessed/alternate file | `goto_last_accessed_file` |
183| `m` | Go to the last modified/alternate file | `goto_last_modified_file` |
184| `n` | Go to next buffer | `goto_next_buffer` |
185| `p` | Go to previous buffer | `goto_previous_buffer` |
186| `.` | Go to last modification in current file | `goto_last_modification` |
190Enter this mode using `m` from normal mode. See the relavant section
191in [Usage](./usage.md) for an explanation about [surround](./usage.md#surround)
192and [textobject](./usage.md#textobject) usage.
194| Key | Description | Command |
195| ----- | ----------- | ------- |
196| `m` | Goto matching bracket (**TS**) | `match_brackets` |
197| `s` `<char>` | Surround current selection with `<char>` | `surround_add` |
198| `r` `<from><to>` | Replace surround character `<from>` with `<to>` | `surround_replace` |
199| `d` `<char>` | Delete surround character `<char>` | `surround_delete` |
200| `a` `<object>` | Select around textobject | `select_textobject_around` |
201| `i` `<object>` | Select inside textobject | `select_textobject_inner` |
203TODO: Mappings for selecting syntax nodes (a superset of `[`).
207This layer is similar to vim keybindings as kakoune does not support window.
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` |
225This layer is a kludge of mappings, mostly pickers.
228| Key | Description | Command |
229| ----- | ----------- | ------- |
230| `f` | Open file picker | `file_picker` |
231| `b` | Open buffer picker | `buffer_picker` |
232| `k` | Show documentation for item under cursor in a [popup](#popup) (**LSP**) | `hover` |
233| `s` | Open document symbol picker (**LSP**) | `symbol_picker` |
234| `S` | Open workspace symbol picker (**LSP**) | `workspace_symbol_picker` |
235| `r` | Rename symbol (**LSP**) | `rename_symbol` |
236| `a` | Apply code action (**LSP**) | `code_action` |
237| `'` | Open last fuzzy picker | `last_picker` |
238| `w` | Enter [window mode](#window-mode) | N/A |
239| `p` | Paste system clipboard after selections | `paste_clipboard_after` |
240| `P` | Paste system clipboard before selections | `paste_clipboard_before` |
241| `y` | Join and yank selections to clipboard | `yank_joined_to_clipboard` |
242| `Y` | Yank main selection to clipboard | `yank_main_selection_to_clipboard` |
243| `R` | Replace selections by clipboard contents | `replace_selections_with_clipboard` |
244| `/` | Global search in workspace folder | `global_search` |
246> TIP: Global search displays results in a fuzzy picker, use `space + '` to bring it back up after opening a file.
250Displays documentation for item under cursor.
253| ---- | ----------- |
254| `Ctrl-u` | Scroll up |
255| `Ctrl-d` | Scroll down |
259Mappings in the style of [vim-unimpaired](https://github.com/tpope/vim-unimpaired).
261| Key | Description | Command |
262| ----- | ----------- | ------- |
263| `[d` | Go to previous diagnostic (**LSP**) | `goto_prev_diag` |
264| `]d` | Go to next diagnostic (**LSP**) | `goto_next_diag` |
265| `[D` | Go to first diagnostic in document (**LSP**) | `goto_first_diag` |
266| `]D` | Go to last diagnostic in document (**LSP**) | `goto_last_diag` |
267| `[space` | Add newline above | `add_newline_above` |
268| `]space` | Add newline below | `add_newline_below` |
272| Key | Description | Command |
273| ----- | ----------- | ------- |
274| `Escape` | Switch to normal mode | `normal_mode` |
275| `Ctrl-x` | Autocomplete | `completion` |
276| `Ctrl-r` | Insert a register content | `insert_register` |
277| `Ctrl-w` | Delete previous word | `delete_word_backward` |
278| `Alt-d` | Delete next word | `delete_word_forward` |
279| `Alt-b`, `Alt-Left` | Backward a word | `move_prev_word_end` |
280| `Ctrl-b`, `Left` | Backward a char | `move_char_left` |
281| `Alt-f`, `Alt-Right` | Forward a word | `move_next_word_start` |
282| `Ctrl-f`, `Right` | Forward a char | `move_char_right` |
283| `Ctrl-e`, `End` | move to line end | `goto_line_end_newline` |
284| `Ctrl-a`, `Home` | move to line start | `goto_line_start` |
285| `Ctrl-u` | delete to start of line | `kill_to_line_start` |
286| `Ctrl-k` | delete to end of line | `kill_to_line_end` |
287| `backspace`, `Ctrl-h` | delete previous char | `delete_char_backward` |
288| `delete`, `Ctrl-d` | delete previous char | `delete_char_forward` |
289| `Ctrl-p`, `Up` | move to previous line | `move_line_up` |
290| `Ctrl-n`, `Down` | move to next line | `move_line_down` |
292## Select / extend mode
294I'm still pondering whether to keep this mode or not. It changes movement
295commands (including goto) to extend the existing selection instead of replacing it.
297> NOTE: It's a bit confusing at the moment because extend hasn't been
298> implemented for all movement commands yet.
302Keys to use within picker. Remapping currently not supported.
305| ----- | ------------- |
306| `Up`, `Ctrl-k`, `Ctrl-p` | Previous entry |
307| `Down`, `Ctrl-j`, `Ctrl-n` | Next entry |
308| `Ctrl-space` | Filter options |
309| `Enter` | Open selected |
310| `Ctrl-s` | Open horizontally |
311| `Ctrl-v` | Open vertically |
312| `Escape`, `Ctrl-c` | Close picker |
316Keys to use within prompt, Remapping currently not supported.
319| ----- | ------------- |
320| `Escape`, `Ctrl-c` | Close prompt |
321| `Alt-b`, `Alt-Left` | Backward a word |
322| `Ctrl-b`, `Left` | Backward a char |
323| `Alt-f`, `Alt-Right` | Forward a word |
324| `Ctrl-f`, `Right` | Forward a char |
325| `Ctrl-e`, `End` | Move prompt end |
326| `Ctrl-a`, `Home` | Move prompt start |
327| `Ctrl-w` | Delete previous word |
328| `Alt-d` | Delete next word |
329| `Ctrl-u` | Delete to start of line |
330| `Ctrl-k` | Delete to end of line |
331| `backspace`, `Ctrl-h` | Delete previous char |
332| `delete`, `Ctrl-d` | Delete next char |
333| `Ctrl-s` | Insert a word under doc cursor, may be changed to Ctrl-r Ctrl-w later |
334| `Ctrl-p`, `Up` | Select previous history |
335| `Ctrl-n`, `Down` | Select next history |
336| `Tab` | Select next completion item |
337| `BackTab` | Select previous completion item |
338| `Enter` | Open selected |
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list