Format docs for better readability

- Wrapped appropriate table elements in inline code blocks
- Added links to different modes
- Capitalised table elements
pull/272/head
Gokul Soumya 3 years ago committed by Benoît Cortier
parent 05ed3e8fb8
commit eb77de6a51

@ -26,62 +26,62 @@ if the key contains a dot `'.'`, it must be quoted to prevent it being parsed as
Possible modifiers: Possible modifiers:
| modifier | | Modifier |
| --- | | --- |
| bold | | `bold` |
| dim | | `dim` |
| italic | | `italic` |
| underlined | | `underlined` |
| slow\_blink | | `slow\_blink` |
| rapid\_blink | | `rapid\_blink` |
| reversed | | `reversed` |
| hidden | | `hidden` |
| crossed\_out | | `crossed\_out` |
Possible keys: Possible keys:
| key | notes | | Key | Notes |
| --- | --- | | --- | --- |
| attribute | | | `attribute` | |
| keyword | | | `keyword` | |
| keyword.directive | preprocessor directives (\#if in C) | | `keyword.directive` | Preprocessor directives (\#if in C) |
| namespace | | | `namespace` | |
| punctuation | | | `punctuation` | |
| punctuation.delimiter | | | `punctuation.delimiter` | |
| operator | | | `operator` | |
| special | | | `special` | |
| property | | | `property` | |
| variable | | | `variable` | |
| variable.parameter | | | `variable.parameter` | |
| type | | | `type` | |
| type.builtin | | | `type.builtin` | |
| constructor | | | `constructor` | |
| function | | | `function` | |
| function.macro | | | `function.macro` | |
| function.builtin | | | `function.builtin` | |
| comment | | | `comment` | |
| variable.builtin | | | `variable.builtin` | |
| constant | | | `constant` | |
| constant.builtin | | | `constant.builtin` | |
| string | | | `string` | |
| number | | | `number` | |
| escape | escaped characters | | `escape` | Escaped characters |
| label | used for lifetimes | | `label` | For lifetimes |
| module | | | `module` | |
| ui.background | | | `ui.background` | |
| ui.linenr | | | `ui.linenr` | |
| ui.statusline | | | `ui.statusline` | |
| ui.popup | | | `ui.popup` | |
| ui.window | | | `ui.window` | |
| ui.help | | | `ui.help` | |
| ui.text | | | `ui.text` | |
| ui.text.focus | | | `ui.text.focus` | |
| ui.menu.selected | | | `ui.menu.selected` | |
| ui.selection | for selections in the editing area | | `ui.selection` | For selections in the editing area |
| warning | LSP warning | | `warning` | LSP warning |
| error | LSP error | | `error` | LSP error |
| info | LSP info | | `info` | LSP info |
| hint | LSP hint | | `hint` | LSP hint |
These keys match [tree-sitter scopes](https://tree-sitter.github.io/tree-sitter/syntax-highlighting#theme). We half-follow the common scopes from [macromates language grammars](https://macromates.com/manual/en/language_grammars) with some differences. These keys match [tree-sitter scopes](https://tree-sitter.github.io/tree-sitter/syntax-highlighting#theme). We half-follow the common scopes from [macromates language grammars](https://macromates.com/manual/en/language_grammars) with some differences.

@ -4,100 +4,102 @@
### Movement ### Movement
| Key | Description | > NOTE: `f`, `F`, `t` and `T` are not confined to the current line.
|-----|-----------|
| h, Left | move left | | Key | Description |
| j, Down | move down | | ----- | ----------- |
| k, Up | move up | | `h`, `Left` | Move left |
| l, Right | move right | | `j`, `Down` | Move down |
| w | move next word start | | `k`, `Up` | Move up |
| b | move previous word start | | `l`, `Right` | Move right |
| e | move next word end | | `w` | Move next word start |
| t | find 'till next char | | `b` | Move previous word start |
| f | find next char | | `e` | Move next word end |
| T | find 'till previous char | | `t` | Find 'till next char |
| F | find previous char | | `f` | Find next char |
| Home | move to the start of the line | | `T` | Find 'till previous char |
| End | move to the end of the line | | `F` | Find previous char |
| m | Jump to matching bracket | | `Home` | Move to the start of the line |
| PageUp | Move page up | | `End` | Move to the end of the line |
| PageDown | Move page down | | `m` | Jump to matching bracket |
| ctrl-u | Move half page up | | `PageUp` | Move page up |
| ctrl-d | Move half page down | | `PageDown` | Move page down |
| ctrl-i | Jump forward on the jumplist TODO: conflicts tab | | `Ctrl-u` | Move half page up |
| ctrl-o | Jump backward on the jumplist | | `Ctrl-d` | Move half page down |
| v | Enter select (extend) mode | | `Ctrl-i` | Jump forward on the jumplist TODO: conflicts tab |
| g | Enter goto mode | | `Ctrl-o` | Jump backward on the jumplist |
| : | Enter command mode | | `v` | Enter [select (extend) mode](#select--extend-mode) |
| z | Enter view mode | | `g` | Enter [goto mode](#goto-mode) |
| ctrl-w | Enter window mode (maybe will be remove for spc w w later) | | `:` | Enter command mode |
| space | Enter space mode | | `z` | Enter [view mode](#view-mode) |
| K | Show documentation for the item under the cursor | | `Ctrl-w` | Enter [window mode](#window-mode) (maybe will be remove for spc w w later) |
| `Space` | Enter [space mode](#space-mode) |
| `K` | Show documentation for the item under the cursor |
### Changes ### Changes
| Key | Description | | Key | Description |
|-----|-----------| | ----- | ----------- |
| r | replace with a character | | `r` | Replace with a character |
| R | replace with yanked text | | `R` | Replace with yanked text |
| i | Insert before selection | | `i` | Insert before selection |
| a | Insert after selection (append) | | `a` | Insert after selection (append) |
| I | Insert at the start of the line | | `I` | Insert at the start of the line |
| A | Insert at the end of the line | | `A` | Insert at the end of the line |
| o | Open new line below selection | | `o` | Open new line below selection |
| o | Open new line above selection | | `o` | Open new line above selection |
| u | Undo change | | `u` | Undo change |
| U | Redo change | | `U` | Redo change |
| y | Yank selection | | `y` | Yank selection |
| p | Paste after selection | | `p` | Paste after selection |
| P | Paste before selection | | `P` | Paste before selection |
| > | Indent selection | | `>` | Indent selection |
| < | Unindent selection | | `<` | Unindent selection |
| = | Format selection | | `=` | Format selection |
| d | Delete selection | | `d` | Delete selection |
| c | Change selection (delete and enter insert mode) | | `c` | Change selection (delete and enter insert mode) |
### Selection manipulation ### Selection manipulation
| Key | Description | | Key | Description |
|-----|-----------| | ----- | ----------- |
| s | Select all regex matches inside selections | | `s` | Select all regex matches inside selections |
| S | Split selection into subselections on regex matches | | `S` | Split selection into subselections on regex matches |
| alt-s | Split selection on newlines | | `Alt-s` | Split selection on newlines |
| ; | Collapse selection onto a single cursor | | `;` | Collapse selection onto a single cursor |
| alt-; | Flip selection cursor and anchor | | `Alt-;` | Flip selection cursor and anchor |
| % | Select entire file | | `%` | Select entire file |
| x | Select current line | | `x` | Select current line |
| X | Extend to next line | | `X` | Extend to next line |
| [ | Expand selection to parent syntax node TODO: pick a key | | `[` | Expand selection to parent syntax node TODO: pick a key |
| J | join lines inside selection | | `J` | join lines inside selection |
| K | keep selections matching the regex TODO: overlapped by hover help | | `K` | keep selections matching the regex TODO: overlapped by hover help |
| space | keep only the primary selection TODO: overlapped by space mode | | `Space` | keep only the primary selection TODO: overlapped by space mode |
| ctrl-c | Comment/uncomment the selections | | `Ctrl-c` | Comment/uncomment the selections |
### Search ### Search
> TODO: The search implementation isn't ideal yet -- we don't support searching > TODO: The search implementation isn't ideal yet -- we don't support searching
in reverse, or searching via smartcase. in reverse, or searching via smartcase.
| Key | Description | | Key | Description |
|-----|-----------| | ----- | ----------- |
| / | Search for regex pattern | | `/` | Search for regex pattern |
| n | Select next search match | | `n` | Select next search match |
| N | Add next search match to selection | | `N` | Add next search match to selection |
| * | Use current selection as the search pattern | | `*` | Use current selection as the search pattern |
### Diagnostics ### Diagnostics
> NOTE: `[` and `]` will likely contain more pair mappings in the style of > NOTE: `[` and `]` will likely contain more pair mappings in the style of
> [vim-unimpaired](https://github.com/tpope/vim-unimpaired) > [vim-unimpaired](https://github.com/tpope/vim-unimpaired)
| Key | Description | | Key | Description |
|-----|-----------| | ----- | ----------- |
| [d | Go to previous diagnostic | | `[d` | Go to previous diagnostic |
| ]d | Go to next diagnostic | | `]d` | Go to next diagnostic |
| [D | Go to first diagnostic in document | | `[D` | Go to first diagnostic in document |
| ]D | Go to last diagnostic in document | | `]D` | Go to last diagnostic in document |
## Select / extend mode ## Select / extend mode
@ -112,14 +114,14 @@ commands to extend the existing selection instead of replacing it.
View mode is intended for scrolling and manipulating the view without changing View mode is intended for scrolling and manipulating the view without changing
the selection. the selection.
| Key | Description | | Key | Description |
|-----|-----------| | ----- | ----------- |
| z , c | Vertically center the line | | `z` , `c` | Vertically center the line |
| t | Align the line to the top of the screen | | `t` | Align the line to the top of the screen |
| b | Align the line to the bottom of the screen | | `b` | Align the line to the bottom of the screen |
| m | Align the line to the middle of the screen (horizontally) | | `m` | Align the line to the middle of the screen (horizontally) |
| j | Scroll the view downwards | | `j` | Scroll the view downwards |
| k | Scroll the view upwards | | `k` | Scroll the view upwards |
## Goto mode ## Goto mode
@ -127,21 +129,21 @@ Jumps to various locations.
> NOTE: Some of these features are only available with the LSP present. > NOTE: Some of these features are only available with the LSP present.
| Key | Description | | Key | Description |
|-----|-----------| | ----- | ----------- |
| g | Go to the start of the file | | `g` | Go to the start of the file |
| e | Go to the end of the file | | `e` | Go to the end of the file |
| h | Go to the start of the line | | `h` | Go to the start of the line |
| l | Go to the end of the line | | `l` | Go to the end of the line |
| s | Go to first non-whitespace character of the line | | `s` | Go to first non-whitespace character of the line |
| t | Go to the top of the screen | | `t` | Go to the top of the screen |
| m | Go to the middle of the screen | | `m` | Go to the middle of the screen |
| b | Go to the bottom of the screen | | `b` | Go to the bottom of the screen |
| d | Go to definition | | `d` | Go to definition |
| y | Go to type definition | | `y` | Go to type definition |
| r | Go to references | | `r` | Go to references |
| i | Go to implementation | | `i` | Go to implementation |
| a | Go to the last accessed/alternate file | | `a` | Go to the last accessed/alternate file |
## Object mode ## Object mode
@ -151,35 +153,35 @@ TODO: Mappings for selecting syntax nodes (a superset of `[`).
This layer is similar to vim keybindings as kakoune does not support window. This layer is similar to vim keybindings as kakoune does not support window.
| Key | Description | | Key | Description |
|-----|-------------| | ----- | ------------- |
| w, ctrl-w | Switch to next window | | `w`, `ctrl-w` | Switch to next window |
| v, ctrl-v | Vertical right split | | `v`, `ctrl-v` | Vertical right split |
| h, ctrl-h | Horizontal bottom split | | `h`, `ctrl-h` | Horizontal bottom split |
| q, ctrl-q | Close current window | | `q`, `ctrl-q` | Close current window |
## Space mode ## Space mode
This layer is a kludge of mappings I had under leader key in neovim. This layer is a kludge of mappings I had under leader key in neovim.
| Key | Description | | Key | Description |
|-----|-----------| | ----- | ----------- |
| f | Open file picker | | `f` | Open file picker |
| b | Open buffer picker | | `b` | Open buffer picker |
| s | Open symbol picker (current document)| | `s` | Open symbol picker (current document) |
| w | Enter window mode | | `w` | Enter [window mode](#window-mode) |
| space | Keep primary selection TODO: it's here because space mode replaced it | | `space` | Keep primary selection TODO: it's here because space mode replaced it |
# Picker # Picker
Keys to use within picker. Keys to use within picker.
| Key | Description | | Key | Description |
|-----|-------------| | ----- | ------------- |
| up, ctrl-p | Previous entry | | `Up`, `Ctrl-p` | Previous entry |
| down, ctrl-n | Next entry | | `Down`, `Ctrl-n` | Next entry |
| ctrl-space | Filter options | | `Ctrl-space` | Filter options |
| enter | Open selected | | `Enter` | Open selected |
| ctrl-h | Open horizontally | | `Ctrl-h` | Open horizontally |
| ctrl-v | Open vertically | | `Ctrl-v` | Open vertically |
| escape, ctrl-c | Close picker | | `Escape`, `ctrl-c` | Close picker |

Loading…
Cancel
Save