2021-04-05 08:18:43 +02:00
|
|
|
# Keymap
|
|
|
|
|
2021-05-12 13:32:44 +02:00
|
|
|
## Normal mode
|
2021-04-05 08:18:43 +02:00
|
|
|
|
2021-05-12 13:32:44 +02:00
|
|
|
### Movement
|
2021-04-05 08:18:43 +02:00
|
|
|
|
|
|
|
| Key | Description |
|
|
|
|
|-----|-----------|
|
2021-06-03 15:58:27 +02:00
|
|
|
| h, Left | move left |
|
|
|
|
| j, Down | move down |
|
|
|
|
| k, Up | move up |
|
|
|
|
| l, Right | move right |
|
2021-04-05 08:18:43 +02:00
|
|
|
| w | move next word start |
|
|
|
|
| b | move previous word start |
|
|
|
|
| e | move next word end |
|
2021-05-12 13:32:44 +02:00
|
|
|
| t | find 'till next char |
|
|
|
|
| f | find next char |
|
|
|
|
| T | find 'till previous char |
|
|
|
|
| F | find previous char |
|
2021-06-05 02:25:46 +02:00
|
|
|
| Home | move to the start of the line |
|
|
|
|
| End | move to the end of the line |
|
2021-06-11 14:57:07 +02:00
|
|
|
| m | Jump to matching bracket |
|
2021-05-12 13:32:44 +02:00
|
|
|
| PageUp | Move page up |
|
|
|
|
| PageDown | Move page down |
|
|
|
|
| ctrl-u | Move half page up |
|
|
|
|
| ctrl-d | Move half page down |
|
|
|
|
| ctrl-i | Jump forward on the jumplist TODO: conflicts tab |
|
|
|
|
| ctrl-o | Jump backward on the jumplist |
|
|
|
|
| v | Enter select (extend) mode |
|
|
|
|
| g | Enter goto mode |
|
|
|
|
| : | Enter command mode |
|
|
|
|
| z | Enter view mode |
|
2021-06-06 07:09:21 +02:00
|
|
|
| ctrl-w | Enter window mode (maybe will be remove for spc w w later) |
|
2021-05-12 13:32:44 +02:00
|
|
|
| space | Enter space mode |
|
|
|
|
| K | Show documentation for the item under the cursor |
|
|
|
|
|
|
|
|
### Changes
|
|
|
|
|
|
|
|
| Key | Description |
|
|
|
|
|-----|-----------|
|
2021-06-07 20:28:39 +02:00
|
|
|
| r | replace with a character |
|
|
|
|
| R | replace with yanked text |
|
2021-05-12 13:32:44 +02:00
|
|
|
| i | Insert before selection |
|
|
|
|
| a | Insert after selection (append) |
|
2021-06-11 14:57:07 +02:00
|
|
|
| I | Insert at the start of the line |
|
|
|
|
| A | Insert at the end of the line |
|
|
|
|
| o | Open new line below selection |
|
|
|
|
| o | Open new line above selection |
|
2021-05-12 13:32:44 +02:00
|
|
|
| u | Undo change |
|
|
|
|
| U | Redo change |
|
|
|
|
| y | Yank selection |
|
|
|
|
| p | Paste after selection |
|
|
|
|
| P | Paste before selection |
|
|
|
|
| > | Indent selection |
|
|
|
|
| < | Unindent selection |
|
|
|
|
| = | Format selection |
|
2021-06-11 14:57:07 +02:00
|
|
|
| d | Delete selection |
|
|
|
|
| c | Change selection (delete and enter insert mode) |
|
2021-05-12 13:32:44 +02:00
|
|
|
|
|
|
|
### Selection manipulation
|
|
|
|
|
|
|
|
| Key | Description |
|
|
|
|
|-----|-----------|
|
2021-06-11 14:57:07 +02:00
|
|
|
| s | Select all regex matches inside selections |
|
|
|
|
| S | Split selection into subselections on regex matches |
|
|
|
|
| alt-s | Split selection on newlines |
|
|
|
|
| ; | Collapse selection onto a single cursor |
|
|
|
|
| alt-; | Flip selection cursor and anchor |
|
|
|
|
| % | Select entire file |
|
|
|
|
| x | Select current line |
|
|
|
|
| X | Extend to next line |
|
|
|
|
| [ | Expand selection to parent syntax node TODO: pick a key |
|
2021-05-12 13:32:44 +02:00
|
|
|
| J | join lines inside selection |
|
|
|
|
| K | keep selections matching the regex TODO: overlapped by hover help |
|
|
|
|
| space | keep only the primary selection TODO: overlapped by space mode |
|
2021-06-11 14:57:07 +02:00
|
|
|
| ctrl-c | Comment/uncomment the selections |
|
2021-05-12 13:32:44 +02:00
|
|
|
|
|
|
|
### Search
|
|
|
|
|
|
|
|
> TODO: The search implementation isn't ideal yet -- we don't support searching
|
|
|
|
in reverse, or searching via smartcase.
|
|
|
|
|
|
|
|
| Key | Description |
|
|
|
|
|-----|-----------|
|
2021-06-11 14:57:07 +02:00
|
|
|
| / | Search for regex pattern |
|
|
|
|
| n | Select next search match |
|
|
|
|
| N | Add next search match to selection |
|
|
|
|
| * | Use current selection as the search pattern |
|
2021-05-12 13:32:44 +02:00
|
|
|
|
2021-06-07 02:24:23 +02:00
|
|
|
### Diagnostics
|
|
|
|
|
|
|
|
> NOTE: `[` and `]` will likely contain more pair mappings in the style of
|
|
|
|
> [vim-unimpaired](https://github.com/tpope/vim-unimpaired)
|
|
|
|
|
|
|
|
| Key | Description |
|
|
|
|
|-----|-----------|
|
|
|
|
| [d | Go to previous diagnostic |
|
|
|
|
| ]d | Go to next diagnostic |
|
|
|
|
| [D | Go to first diagnostic in document |
|
|
|
|
| ]D | Go to last diagnostic in document |
|
|
|
|
|
2021-05-12 13:32:44 +02:00
|
|
|
## Select / extend mode
|
|
|
|
|
|
|
|
I'm still pondering whether to keep this mode or not. It changes movement
|
|
|
|
commands to extend the existing selection instead of replacing it.
|
|
|
|
|
|
|
|
> NOTE: It's a bit confusing at the moment because extend hasn't been
|
|
|
|
> implemented for all movement commands yet.
|
|
|
|
|
|
|
|
## View mode
|
|
|
|
|
|
|
|
View mode is intended for scrolling and manipulating the view without changing
|
|
|
|
the selection.
|
|
|
|
|
|
|
|
| Key | Description |
|
|
|
|
|-----|-----------|
|
|
|
|
| z , c | Vertically center the line |
|
|
|
|
| t | Align the line to the top of the screen |
|
|
|
|
| b | Align the line to the bottom of the screen |
|
|
|
|
| m | Align the line to the middle of the screen (horizontally) |
|
|
|
|
| j | Scroll the view downwards |
|
|
|
|
| k | Scroll the view upwards |
|
|
|
|
|
|
|
|
## Goto mode
|
|
|
|
|
|
|
|
Jumps to various locations.
|
|
|
|
|
|
|
|
> NOTE: Some of these features are only available with the LSP present.
|
|
|
|
|
|
|
|
| Key | Description |
|
|
|
|
|-----|-----------|
|
|
|
|
| g | Go to the start of the file |
|
|
|
|
| e | Go to the end of the file |
|
2021-06-04 09:34:08 +02:00
|
|
|
| h | Go to the start of the line |
|
|
|
|
| l | Go to the end of the line |
|
2021-06-08 08:25:55 +02:00
|
|
|
| s | Go to first non-whitespace character of the line |
|
2021-06-04 08:47:29 +02:00
|
|
|
| t | Go to the top of the screen |
|
|
|
|
| m | Go to the middle of the screen |
|
|
|
|
| b | Go to the bottom of the screen |
|
2021-06-01 22:36:42 +02:00
|
|
|
| d | Go to definition |
|
2021-06-04 08:47:29 +02:00
|
|
|
| y | Go to type definition |
|
2021-05-12 13:32:44 +02:00
|
|
|
| r | Go to references |
|
|
|
|
| i | Go to implementation |
|
2021-06-12 14:21:06 +02:00
|
|
|
| a | Go to the last accessed/alternate file |
|
2021-05-12 13:32:44 +02:00
|
|
|
|
|
|
|
## Object mode
|
|
|
|
|
|
|
|
TODO: Mappings for selecting syntax nodes (a superset of `[`).
|
|
|
|
|
2021-06-05 09:45:24 +02:00
|
|
|
## Window mode
|
|
|
|
|
|
|
|
This layer is similar to vim keybindings as kakoune does not support window.
|
|
|
|
|
|
|
|
| Key | Description |
|
|
|
|
|-----|-------------|
|
|
|
|
| w, ctrl-w | Switch to next window |
|
|
|
|
| v, ctrl-v | Vertical right split |
|
|
|
|
| h, ctrl-h | Horizontal bottom split |
|
|
|
|
| q, ctrl-q | Close current window |
|
|
|
|
|
2021-05-12 13:32:44 +02:00
|
|
|
## Space mode
|
|
|
|
|
|
|
|
This layer is a kludge of mappings I had under leader key in neovim.
|
2021-04-05 08:18:43 +02:00
|
|
|
|
|
|
|
| Key | Description |
|
|
|
|
|-----|-----------|
|
2021-05-12 13:32:44 +02:00
|
|
|
| f | Open file picker |
|
|
|
|
| b | Open buffer picker |
|
2021-06-12 14:45:21 +02:00
|
|
|
| s | Open symbol picker (current document)|
|
2021-06-06 07:09:21 +02:00
|
|
|
| w | Enter window mode |
|
2021-05-12 13:32:44 +02:00
|
|
|
| space | Keep primary selection TODO: it's here because space mode replaced it |
|
2021-06-12 12:46:05 +02:00
|
|
|
|
|
|
|
# Picker
|
|
|
|
|
|
|
|
Keys to use within picker.
|
|
|
|
|
|
|
|
| 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 |
|