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| `Alt-.` | Repeat last motion (`f`, `t` or `m`) | `repeat_last_motion` |
29| `Home` | Move to the start of the line | `goto_line_start` |
30| `End` | Move to the end of the line | `goto_line_end` |
31| `PageUp` | Move page up | `page_up` |
32| `PageDown` | Move page down | `page_down` |
33| `Ctrl-u` | Move half page up | `half_page_up` |
34| `Ctrl-d` | Move half page down | `half_page_down` |
35| `Ctrl-i` | Jump forward on the jumplist | `jump_forward` |
36| `Ctrl-o` | Jump backward on the jumplist | `jump_backward` |
37| `Ctrl-s` | Save the current selection to the jumplist | `save_selection` |
38| `v` | Enter [select (extend) mode](#select--extend-mode) | `select_mode` |
39| `g` | Enter [goto mode](#goto-mode) | N/A |
40| `m` | Enter [match mode](#match-mode) | N/A |
41| `:` | Enter command mode | `command_mode` |
42| `z` | Enter [view mode](#view-mode) | N/A |
43| `Z` | Enter sticky [view mode](#view-mode) | N/A |
44| `Ctrl-w` | Enter [window mode](#window-mode) | N/A |
45| `Space` | Enter [space mode](#space-mode) | N/A |
49| Key | Description | Command |
50| ----- | ----------- | ------- |
51| `r` | Replace with a character | `replace` |
52| `R` | Replace with yanked text | `replace_with_yanked` |
53| `~` | Switch case of the selected text | `switch_case` |
54| `` ` `` | Set the selected text to lower case | `switch_to_lowercase` |
55| `` Alt-` `` | Set the selected text to upper case | `switch_to_uppercase` |
56| `i` | Insert before selection | `insert_mode` |
57| `a` | Insert after selection (append) | `append_mode` |
58| `I` | Insert at the start of the line | `prepend_to_line` |
59| `A` | Insert at the end of the line | `append_to_line` |
60| `o` | Open new line below selection | `open_below` |
61| `O` | Open new line above selection | `open_above` |
62| `.` | Repeat last change | N/A |
63| `u` | Undo change | `undo` |
64| `U` | Redo change | `redo` |
65| `Alt-u` | Move backward in history | `earlier` |
66| `Alt-U` | Move forward in history | `later` |
67| `y` | Yank selection | `yank` |
68| `p` | Paste after selection | `paste_after` |
69| `P` | Paste before selection | `paste_before` |
70| `"` `<reg>` | Select a register to yank to or paste from | `select_register` |
71| `>` | Indent selection | `indent` |
72| `<` | Unindent selection | `unindent` |
73| `=` | Format selection (currently nonfunctional/disabled) (**LSP**) | `format_selections` |
74| `d` | Delete selection | `delete_selection` |
75| `Alt-d` | Delete selection, without yanking | `delete_selection_noyank` |
76| `c` | Change selection (delete and enter insert mode) | `change_selection` |
77| `Alt-c` | Change selection (delete and enter insert mode, without yanking) | `change_selection_noyank` |
78| `Ctrl-a` | Increment object (number) under cursor | `increment` |
79| `Ctrl-x` | Decrement object (number) under cursor | `decrement` |
80| `Q` | Start/stop macro recording to the selected register (experimental) | `record_macro` |
81| `q` | Play back a recorded macro from the selected register (experimental) | `replay_macro` |
85| Key | Description | Command |
86| ------ | ----------- | ------- |
87| <code>|</code> | Pipe each selection through shell command, replacing with output | `shell_pipe` |
88| <code>Alt-|</code> | Pipe each selection into shell command, ignoring output | `shell_pipe_to` |
89| `!` | Run shell command, inserting output before each selection | `shell_insert_output` |
90| `Alt-!` | Run shell command, appending output after each selection | `shell_append_output` |
93### Selection manipulation
95| Key | Description | Command |
96| ----- | ----------- | ------- |
97| `s` | Select all regex matches inside selections | `select_regex` |
98| `S` | Split selection into subselections on regex matches | `split_selection` |
99| `Alt-s` | Split selection on newlines | `split_selection_on_newline` |
100| `&` | Align selection in columns | `align_selections` |
101| `_` | Trim whitespace from the selection | `trim_selections` |
102| `;` | Collapse selection onto a single cursor | `collapse_selection` |
103| `Alt-;` | Flip selection cursor and anchor | `flip_selections` |
104| `,` | Keep only the primary selection | `keep_primary_selection` |
105| `Alt-,` | Remove the primary selection | `remove_primary_selection` |
106| `C` | Copy selection onto the next line (Add cursor below) | `copy_selection_on_next_line` |
107| `Alt-C` | Copy selection onto the previous line (Add cursor above) | `copy_selection_on_prev_line` |
108| `(` | Rotate main selection backward | `rotate_selections_backward` |
109| `)` | Rotate main selection forward | `rotate_selections_forward` |
110| `Alt-(` | Rotate selection contents backward | `rotate_selection_contents_backward` |
111| `Alt-)` | Rotate selection contents forward | `rotate_selection_contents_forward` |
112| `%` | Select entire file | `select_all` |
113| `x` | Select current line, if already selected, extend to next line | `extend_line` |
114| `X` | Extend selection to line bounds (line-wise selection) | `extend_to_line_bounds` |
115| | Expand selection to parent syntax node TODO: pick a key (**TS**) | `expand_selection` |
116| `J` | Join lines inside selection | `join_selections` |
117| `K` | Keep selections matching the regex | `keep_selections` |
118| `Alt-K` | Remove selections matching the regex | `remove_selections` |
119| `$` | Pipe each selection into shell command, keep selections where command returned 0 | `shell_keep_pipe` |
120| `Ctrl-c` | Comment/uncomment the selections | `toggle_comments` |
125| Key | Description | Command |
126| ----- | ----------- | ------- |
127| `/` | Search for regex pattern | `search` |
128| `?` | Search for previous pattern | `rsearch` |
129| `n` | Select next search match | `search_next` |
130| `N` | Select previous search match | `search_prev` |
131| `*` | Use current selection as the search pattern | `search_selection` |
135These sub-modes are accessible from normal mode and typically switch back to normal mode after a command.
139View mode is intended for scrolling and manipulating the view without changing
140the selection. The "sticky" variant of this mode is persistent; use the Escape
141key to return to normal mode after usage (useful when you're simply looking
142over text and not actively editing it).
145| Key | Description | Command |
146| ----- | ----------- | ------- |
147| `z` , `c` | Vertically center the line | `align_view_center` |
148| `t` | Align the line to the top of the screen | `align_view_top` |
149| `b` | Align the line to the bottom of the screen | `align_view_bottom` |
150| `m` | Align the line to the middle of the screen (horizontally) | `align_view_middle` |
151| `j` , `down` | Scroll the view downwards | `scroll_down` |
152| `k` , `up` | Scroll the view upwards | `scroll_up` |
153| `f` | Move page down | `page_down` |
154| `b` | Move page up | `page_up` |
155| `d` | Move half page down | `half_page_down` |
156| `u` | Move half page up | `half_page_up` |
160Jumps to various locations.
162| Key | Description | Command |
163| ----- | ----------- | ------- |
164| `g` | Go to line number `<n>` else start of file | `goto_file_start` |
165| `e` | Go to the end of the file | `goto_last_line` |
166| `f` | Go to files in the selection | `goto_file` |
167| `h` | Go to the start of the line | `goto_line_start` |
168| `l` | Go to the end of the line | `goto_line_end` |
169| `s` | Go to first non-whitespace character of the line | `goto_first_nonwhitespace` |
170| `t` | Go to the top of the screen | `goto_window_top` |
171| `c` | Go to the middle of the screen | `goto_window_center` |
172| `b` | Go to the bottom of the screen | `goto_window_bottom` |
173| `d` | Go to definition (**LSP**) | `goto_definition` |
174| `y` | Go to type definition (**LSP**) | `goto_type_definition` |
175| `r` | Go to references (**LSP**) | `goto_reference` |
176| `i` | Go to implementation (**LSP**) | `goto_implementation` |
177| `a` | Go to the last accessed/alternate file | `goto_last_accessed_file` |
178| `m` | Go to the last modified/alternate file | `goto_last_modified_file` |
179| `n` | Go to next buffer | `goto_next_buffer` |
180| `p` | Go to previous buffer | `goto_previous_buffer` |
181| `.` | Go to last modification in current file | `goto_last_modification` |
185Enter this mode using `m` from normal mode. See the relavant section
186in [Usage](./usage.md) for an explanation about [surround](./usage.md#surround)
187and [textobject](./usage.md#textobject) usage.
189| Key | Description | Command |
190| ----- | ----------- | ------- |
191| `m` | Goto matching bracket (**TS**) | `match_brackets` |
192| `s` `<char>` | Surround current selection with `<char>` | `surround_add` |
193| `r` `<from><to>` | Replace surround character `<from>` with `<to>` | `surround_replace` |
194| `d` `<char>` | Delete surround character `<char>` | `surround_delete` |
195| `a` `<object>` | Select around textobject | `select_textobject_around` |
196| `i` `<object>` | Select inside textobject | `select_textobject_inner` |
198TODO: Mappings for selecting syntax nodes (a superset of `[`).
202This layer is similar to vim keybindings as kakoune does not support window.
204| Key | Description | Command |
205| ----- | ------------- | ------- |
206| `w`, `Ctrl-w` | Switch to next window | `rotate_view` |
207| `v`, `Ctrl-v` | Vertical right split | `vsplit` |
208| `s`, `Ctrl-s` | Horizontal bottom split | `hsplit` |
209| `h`, `Ctrl-h`, `left` | Move to left split | `jump_view_left` |
210| `f` | Go to files in the selection in horizontal splits | `goto_file` |
211| `F` | Go to files in the selection in vertical splits | `goto_file` |
212| `j`, `Ctrl-j`, `down` | Move to split below | `jump_view_down` |
213| `k`, `Ctrl-k`, `up` | Move to split above | `jump_view_up` |
214| `l`, `Ctrl-l`, `right` | Move to right split | `jump_view_right` |
215| `q`, `Ctrl-q` | Close current window | `wclose` |
216| `o`, `Ctrl-o` | Only keep the current window, closing all the others | `wonly` |
220This layer is a kludge of mappings, mostly pickers.
223| Key | Description | Command |
224| ----- | ----------- | ------- |
225| `f` | Open file picker | `file_picker` |
226| `b` | Open buffer picker | `buffer_picker` |
227| `k` | Show documentation for item under cursor in a [popup](#popup) (**LSP**) | `hover` |
228| `s` | Open document symbol picker (**LSP**) | `symbol_picker` |
229| `S` | Open workspace symbol picker (**LSP**) | `workspace_symbol_picker` |
230| `r` | Rename symbol (**LSP**) | `rename_symbol` |
231| `a` | Apply code action (**LSP**) | `code_action` |
232| `'` | Open last fuzzy picker | `last_picker` |
233| `w` | Enter [window mode](#window-mode) | N/A |
234| `p` | Paste system clipboard after selections | `paste_clipboard_after` |
235| `P` | Paste system clipboard before selections | `paste_clipboard_before` |
236| `y` | Join and yank selections to clipboard | `yank_joined_to_clipboard` |
237| `Y` | Yank main selection to clipboard | `yank_main_selection_to_clipboard` |
238| `R` | Replace selections by clipboard contents | `replace_selections_with_clipboard` |
239| `/` | Global search in workspace folder | `global_search` |
241> TIP: Global search displays results in a fuzzy picker, use `space + '` to bring it back up after opening a file.
245Displays documentation for item under cursor.
248| ---- | ----------- |
249| `Ctrl-u` | Scroll up |
250| `Ctrl-d` | Scroll down |
254Mappings in the style of [vim-unimpaired](https://github.com/tpope/vim-unimpaired).
256| Key | Description | Command |
257| ----- | ----------- | ------- |
258| `[d` | Go to previous diagnostic (**LSP**) | `goto_prev_diag` |
259| `]d` | Go to next diagnostic (**LSP**) | `goto_next_diag` |
260| `[D` | Go to first diagnostic in document (**LSP**) | `goto_first_diag` |
261| `]D` | Go to last diagnostic in document (**LSP**) | `goto_last_diag` |
262| `[space` | Add newline above | `add_newline_above` |
263| `]space` | Add newline below | `add_newline_below` |
267| Key | Description | Command |
268| ----- | ----------- | ------- |
269| `Escape` | Switch to normal mode | `normal_mode` |
270| `Ctrl-x` | Autocomplete | `completion` |
271| `Ctrl-r` | Insert a register content | `insert_register` |
272| `Ctrl-w` | Delete previous word | `delete_word_backward` |
273| `Alt-d` | Delete next word | `delete_word_forward` |
274| `Alt-b`, `Alt-Left` | Backward a word | `move_prev_word_end` |
275| `Ctrl-b`, `Left` | Backward a char | `move_char_left` |
276| `Alt-f`, `Alt-Right` | Forward a word | `move_next_word_start` |
277| `Ctrl-f`, `Right` | Forward a char | `move_char_right` |
278| `Ctrl-e`, `End` | move to line end | `goto_line_end_newline` |
279| `Ctrl-a`, `Home` | move to line start | `goto_line_start` |
280| `Ctrl-u` | delete to start of line | `kill_to_line_start` |
281| `Ctrl-k` | delete to end of line | `kill_to_line_end` |
282| `backspace`, `Ctrl-h` | delete previous char | `delete_char_backward` |
283| `delete`, `Ctrl-d` | delete previous char | `delete_char_forward` |
284| `Ctrl-p`, `Up` | move to previous line | `move_line_up` |
285| `Ctrl-n`, `Down` | move to next line | `move_line_down` |
287## Select / extend mode
289I'm still pondering whether to keep this mode or not. It changes movement
290commands (including goto) to extend the existing selection instead of replacing it.
292> NOTE: It's a bit confusing at the moment because extend hasn't been
293> implemented for all movement commands yet.
297Keys to use within picker. Remapping currently not supported.
300| ----- | ------------- |
301| `Up`, `Ctrl-k`, `Ctrl-p` | Previous entry |
302| `Down`, `Ctrl-j`, `Ctrl-n` | Next entry |
303| `Ctrl-space` | Filter options |
304| `Enter` | Open selected |
305| `Ctrl-s` | Open horizontally |
306| `Ctrl-v` | Open vertically |
307| `Escape`, `Ctrl-c` | Close picker |
311Keys to use within prompt, Remapping currently not supported.
314| ----- | ------------- |
315| `Escape`, `Ctrl-c` | Close prompt |
316| `Alt-b`, `Alt-Left` | Backward a word |
317| `Ctrl-b`, `Left` | Backward a char |
318| `Alt-f`, `Alt-Right` | Forward a word |
319| `Ctrl-f`, `Right` | Forward a char |
320| `Ctrl-e`, `End` | Move prompt end |
321| `Ctrl-a`, `Home` | Move prompt start |
322| `Ctrl-w` | Delete previous word |
323| `Alt-d` | Delete next word |
324| `Ctrl-u` | Delete to start of line |
325| `Ctrl-k` | Delete to end of line |
326| `backspace`, `Ctrl-h` | Delete previous char |
327| `delete`, `Ctrl-d` | Delete next char |
328| `Ctrl-s` | Insert a word under doc cursor, may be changed to Ctrl-r Ctrl-w later |
329| `Ctrl-p`, `Up` | Select previous history |
330| `Ctrl-n`, `Down` | Select next history |
331| `Tab` | Select next completion item |
332| `BackTab` | Select previous completion item |
333| `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