7> NOTE: Unlike vim, `f`, `F`, `t` and `T` are not confined to the current line.
9| Key | Description | Command |
10| ----- | ----------- | ------- |
11| `h`/`Left` | Move left | `move_char_left` |
12| `j`/`Down` | Move down | `move_line_down` |
13| `k`/`Up` | Move up | `move_line_up` |
14| `l`/`Right` | Move right | `move_char_right` |
15| `w` | Move next word start | `move_next_word_start` |
16| `b` | Move previous word start | `move_prev_word_start` |
17| `e` | Move next word end | `move_next_word_end` |
18| `W` | Move next WORD start | `move_next_long_word_start` |
19| `B` | Move previous WORD start | `move_prev_long_word_start` |
20| `E` | Move next WORD end | `move_next_long_word_end` |
21| `t` | Find 'till next char | `find_till_char` |
22| `f` | Find next char | `find_next_char` |
23| `T` | Find 'till previous char | `till_prev_char` |
24| `F` | Find previous char | `find_prev_char` |
25| `Alt-.` | Repeat last motion (`f`, `t` or `m`) | `repeat_last_motion` |
26| `Home` | Move to the start of the line | `goto_line_start` |
27| `End` | Move to the end of the line | `goto_line_end` |
28| `PageUp` | Move page up | `page_up` |
29| `PageDown` | Move page down | `page_down` |
30| `Ctrl-u` | Move half page up | `half_page_up` |
31| `Ctrl-d` | Move half page down | `half_page_down` |
32| `Ctrl-i` | Jump forward on the jumplist | `jump_forward` |
33| `Ctrl-o` | Jump backward on the jumplist | `jump_backward` |
34| `v` | Enter [select (extend) mode](#select--extend-mode) | `select_mode` |
35| `g` | Enter [goto mode](#goto-mode) | N/A |
36| `m` | Enter [match mode](#match-mode) | N/A |
37| `:` | Enter command mode | `command_mode` |
38| `z` | Enter [view mode](#view-mode) | N/A |
39| `Z` | Enter sticky [view mode](#view-mode) | N/A |
40| `Ctrl-w` | Enter [window mode](#window-mode) | N/A |
41| `Space` | Enter [space mode](#space-mode) | N/A |
45| Key | Description | Command |
46| ----- | ----------- | ------- |
47| `r` | Replace with a character | `replace` |
48| `R` | Replace with yanked text | `replace_with_yanked` |
49| `~` | Switch case of the selected text | `switch_case` |
50| `` ` `` | Set the selected text to lower case | `switch_to_lowercase` |
51| `` Alt-` `` | Set the selected text to upper case | `switch_to_uppercase` |
52| `i` | Insert before selection | `insert_mode` |
53| `a` | Insert after selection (append) | `append_mode` |
54| `I` | Insert at the start of the line | `prepend_to_line` |
55| `A` | Insert at the end of the line | `append_to_line` |
56| `o` | Open new line below selection | `open_below` |
57| `O` | Open new line above selection | `open_above` |
58| `.` | Repeat last change | N/A |
59| `u` | Undo change | `undo` |
60| `U` | Redo change | `redo` |
61| `y` | Yank selection | `yank` |
62| `p` | Paste after selection | `paste_after` |
63| `P` | Paste before selection | `paste_before` |
64| `"` `<reg>` | Select a register to yank to or paste from | `select_register` |
65| `>` | Indent selection | `indent` |
66| `<` | Unindent selection | `unindent` |
67| `=` | Format selection | `format_selections` |
68| `d` | Delete selection | `delete_selection` |
69| `c` | Change selection (delete and enter insert mode) | `change_selection` |
73| Key | Description | Command |
74| ------ | ----------- | ------- |
75| <code>|</code> | Pipe each selection through shell command, replacing with output | `shell_pipe` |
76| <code>A-|</code> | Pipe each selection into shell command, ignoring output | `shell_pipe_to` |
77| `!` | Run shell command, inserting output before each selection | `shell_insert_output` |
78| `A-!` | Run shell command, appending output after each selection | `shell_append_output` |
81### Selection manipulation
83| Key | Description | Command |
84| ----- | ----------- | ------- |
85| `s` | Select all regex matches inside selections | `select_regex` |
86| `S` | Split selection into subselections on regex matches | `split_selection` |
87| `Alt-s` | Split selection on newlines | `split_selection_on_newline` |
88| `;` | Collapse selection onto a single cursor | `collapse_selection` |
89| `Alt-;` | Flip selection cursor and anchor | `flip_selections` |
90| `,` | Keep only the primary selection | `keep_primary_selection` |
91| `Alt-,` | Remove the primary selection | `remove_primary_selection` |
92| `C` | Copy selection onto the next line (Add cursor below) | `copy_selection_on_next_line` |
93| `Alt-C` | Copy selection onto the previous line (Add cursor above) | `copy_selection_on_prev_line` |
94| `(` | Rotate main selection backward | `rotate_selections_backward` |
95| `)` | Rotate main selection forward | `rotate_selections_forward` |
96| `Alt-(` | Rotate selection contents backward | `rotate_selection_contents_backward` |
97| `Alt-)` | Rotate selection contents forward | `rotate_selection_contents_forward` |
98| `%` | Select entire file | `select_all` |
99| `x` | Select current line, if already selected, extend to next line | `extend_line` |
100| `X` | Extend selection to line bounds (line-wise selection) | `extend_to_line_bounds` |
101| | Expand selection to parent syntax node TODO: pick a key | `expand_selection` |
102| `J` | Join lines inside selection | `join_selections` |
103| `K` | Keep selections matching the regex | `keep_selections` |
104| `$` | Pipe each selection into shell command, keep selections where command returned 0 | `shell_keep_pipe` |
105| `Ctrl-c` | Comment/uncomment the selections | `toggle_comments` |
110| Key | Description | Command |
111| ----- | ----------- | ------- |
112| `/` | Search for regex pattern | `search` |
113| `?` | Search for previous pattern | `rsearch` |
114| `n` | Select next search match | `search_next` |
115| `N` | Select previous search match | `search_prev` |
116| `*` | Use current selection as the search pattern | `search_selection` |
120These sub-modes are accessible from normal mode and typically switch back to normal mode after a command.
124View mode is intended for scrolling and manipulating the view without changing
125the selection. The "sticky" variant of this mode is persistent; use the Escape
126key to return to normal mode after usage (useful when you're simply looking
127over text and not actively editing it).
130| Key | Description | Command |
131| ----- | ----------- | ------- |
132| `z` , `c` | Vertically center the line | `align_view_center` |
133| `t` | Align the line to the top of the screen | `align_view_top` |
134| `b` | Align the line to the bottom of the screen | `align_view_bottom` |
135| `m` | Align the line to the middle of the screen (horizontally) | `align_view_middle` |
136| `j` | Scroll the view downwards | `scroll_down` |
137| `k` | Scroll the view upwards | `scroll_up` |
138| `f` | Move page down | `page_down` |
139| `b` | Move page up | `page_up` |
140| `d` | Move half page down | `half_page_down` |
141| `u` | Move half page up | `half_page_up` |
145Jumps to various locations.
147> NOTE: Some of these features are only available with the LSP present.
149| Key | Description | Command |
150| ----- | ----------- | ------- |
151| `g` | Go to the start of the file | `goto_file_start` |
152| `e` | Go to the end of the file | `goto_last_line` |
153| `h` | Go to the start of the line | `goto_line_start` |
154| `l` | Go to the end of the line | `goto_line_end` |
155| `s` | Go to first non-whitespace character of the line | `goto_first_nonwhitespace` |
156| `t` | Go to the top of the screen | `goto_window_top` |
157| `m` | Go to the middle of the screen | `goto_window_middle` |
158| `b` | Go to the bottom of the screen | `goto_window_bottom` |
159| `d` | Go to definition | `goto_definition` |
160| `y` | Go to type definition | `goto_type_definition` |
161| `r` | Go to references | `goto_reference` |
162| `i` | Go to implementation | `goto_implementation` |
163| `a` | Go to the last accessed/alternate file | `goto_last_accessed_file` |
164| `n` | Go to next buffer | `goto_next_buffer` |
165| `p` | Go to previous buffer | `goto_previous_buffer` |
169Enter this mode using `m` from normal mode. See the relavant section
170in [Usage](./usage.md) for an explanation about [surround](./usage.md#surround)
171and [textobject](./usage.md#textobject) usage.
173| Key | Description | Command |
174| ----- | ----------- | ------- |
175| `m` | Goto matching bracket | `match_brackets` |
176| `s` `<char>` | Surround current selection with `<char>` | `surround_add` |
177| `r` `<from><to>` | Replace surround character `<from>` with `<to>` | `surround_replace` |
178| `d` `<char>` | Delete surround character `<char>` | `surround_delete` |
179| `a` `<object>` | Select around textobject | `select_textobject_around` |
180| `i` `<object>` | Select inside textobject | `select_textobject_inner` |
182TODO: Mappings for selecting syntax nodes (a superset of `[`).
186This layer is similar to vim keybindings as kakoune does not support window.
188| Key | Description | Command |
189| ----- | ------------- | ------- |
190| `w`, `Ctrl-w` | Switch to next window | `rotate_view` |
191| `v`, `Ctrl-v` | Vertical right split | `vsplit` |
192| `s`, `Ctrl-s` | Horizontal bottom split | `hsplit` |
193| `h`, `Ctrl-h`, `left` | Move to left split | `jump_view_left` |
194| `j`, `Ctrl-j`, `down` | Move to split below | `jump_view_down` |
195| `k`, `Ctrl-k`, `up` | Move to split above | `jump_view_up` |
196| `l`, `Ctrl-l`, `right` | Move to right split | `jump_view_right` |
197| `q`, `Ctrl-q` | Close current window | `wclose` |
201This layer is a kludge of mappings, mostly pickers.
203| Key | Description | Command |
204| ----- | ----------- | ------- |
205| `k` | Show documentation for the item under the cursor | `hover` |
206| `f` | Open file picker | `file_picker` |
207| `b` | Open buffer picker | `buffer_picker` |
208| `s` | Open symbol picker (current document) | `symbol_picker` |
209| `a` | Apply code action | `code_action` |
210| `'` | Open last fuzzy picker | `last_picker` |
211| `w` | Enter [window mode](#window-mode) | N/A |
212| `p` | Paste system clipboard after selections | `paste_clipboard_after` |
213| `P` | Paste system clipboard before selections | `paste_clipboard_before` |
214| `y` | Join and yank selections to clipboard | `yank_joined_to_clipboard` |
215| `Y` | Yank main selection to clipboard | `yank_main_selection_to_clipboard` |
216| `R` | Replace selections by clipboard contents | `replace_selections_with_clipboard` |
217| `/` | Global search in workspace folder | `global_search` |
219> NOTE: Global search display results in a fuzzy picker, use `space + '` to bring it back up after opening a file.
223Mappings in the style of [vim-unimpaired](https://github.com/tpope/vim-unimpaired).
225| Key | Description | Command |
226| ----- | ----------- | ------- |
227| `[d` | Go to previous diagnostic | `goto_prev_diag` |
228| `]d` | Go to next diagnostic | `goto_next_diag` |
229| `[D` | Go to first diagnostic in document | `goto_first_diag` |
230| `]D` | Go to last diagnostic in document | `goto_last_diag` |
231| `[space` | Add newline above | `add_newline_above` |
232| `]space` | Add newline below | `add_newline_below` |
236| Key | Description | Command |
237| ----- | ----------- | ------- |
238| `Escape` | Switch to normal mode | `normal_mode` |
239| `Ctrl-x` | Autocomplete | `completion` |
240| `Ctrl-w` | Delete previous word | `delete_word_backward` |
242## Select / extend mode
244I'm still pondering whether to keep this mode or not. It changes movement
245commands (including goto) to extend the existing selection instead of replacing it.
247> NOTE: It's a bit confusing at the moment because extend hasn't been
248> implemented for all movement commands yet.
252Keys to use within picker. Remapping currently not supported.
255| ----- | ------------- |
256| `Up`, `Ctrl-k`, `Ctrl-p` | Previous entry |
257| `Down`, `Ctrl-j`, `Ctrl-n` | Next entry |
258| `Ctrl-space` | Filter options |
259| `Enter` | Open selected |
260| `Ctrl-s` | Open horizontally |
261| `Ctrl-v` | Open vertically |
262| `Escape`, `Ctrl-c` | Close picker |
265Keys to use within prompt, Remapping currently not supported.
267| ----- | ------------- |
268| `Escape`, `Ctrl-c` | Close prompt |
269| `Alt-b`, `Alt-Left` | Backward a word |
270| `Ctrl-b`, `Left` | Backward a char |
271| `Alt-f`, `Alt-Right` | Forward a word |
272| `Ctrl-f`, `Right` | Forward a char |
273| `Ctrl-e`, `End` | move prompt end |
274| `Ctrl-a`, `Home` | move prompt start |
275| `Ctrl-w` | delete previous word |
276| `Ctrl-k` | delete to end of line |
277| `backspace` | delete previous char |
278| `Ctrl-s` | insert a word under doc cursor, may be changed to Ctrl-r Ctrl-w later |
279| `Ctrl-p`, `Up` | select previous history |
280| `Ctrl-n`, `Down` | select next history |
281| `Tab` | slect next completion item |
282| `BackTab` | slect previous completion item |
283| `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