aboutsummaryrefslogtreecommitdiff
path: root/book
diff options
context:
space:
mode:
authorGokul Soumya2022-01-06 05:56:35 +0000
committerGokul Soumya2022-01-06 06:02:03 +0000
commit449624965b05fd2abc9e3ba2f791f8de8b1eeb3e (patch)
treecbe060df6a61330e6a470c521ed254f5c7dc4f4f /book
parentc0bbadcaaf42698d102fa03f6f9267021f3efec0 (diff)
parent2e02a1d6bc004212033b9c4e5ed0de0fd880796c (diff)
Merge branch 'master' into cursor-shape-new
Diffstat (limited to 'book')
-rw-r--r--book/src/generated/lang-support.md21
-rw-r--r--book/src/generated/typable-cmd.md4
-rw-r--r--book/src/guides/adding_languages.md37
-rw-r--r--book/src/keymap.md70
-rw-r--r--book/src/languages.md1
-rw-r--r--book/src/themes.md12
6 files changed, 90 insertions, 55 deletions
diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md
index 80989e63..a1fbf172 100644
--- a/book/src/generated/lang-support.md
+++ b/book/src/generated/lang-support.md
@@ -1,12 +1,19 @@
| Language | Syntax Highlighting | Treesitter Textobjects | Auto Indent | Default LSP |
| --- | --- | --- | --- | --- |
| bash | ✓ | | | `bash-language-server` |
-| c | ✓ | | | `clangd` |
+| c | ✓ | ✓ | ✓ | `clangd` |
| c-sharp | ✓ | | | |
-| cmake | ✓ | | | `cmake-language-server` |
-| cpp | ✓ | | | `clangd` |
+| cmake | ✓ | ✓ | ✓ | `cmake-language-server` |
+| comment | ✓ | | | |
+| cpp | ✓ | ✓ | ✓ | `clangd` |
| css | ✓ | | | |
+| dart | ✓ | | ✓ | `dart` |
+| dockerfile | ✓ | | | `docker-langserver` |
| elixir | ✓ | | | `elixir-ls` |
+| fish | ✓ | ✓ | ✓ | |
+| git-commit | ✓ | | | |
+| git-diff | ✓ | | | |
+| git-rebase | ✓ | | | |
| glsl | ✓ | | ✓ | |
| go | ✓ | ✓ | ✓ | `gopls` |
| html | ✓ | | | |
@@ -16,7 +23,9 @@
| julia | ✓ | | | `julia` |
| latex | ✓ | | | |
| ledger | ✓ | | | |
-| llvm | ✓ | | | |
+| llvm | ✓ | ✓ | ✓ | |
+| llvm-mir | ✓ | ✓ | ✓ | |
+| llvm-mir-yaml | ✓ | | ✓ | |
| lua | ✓ | | ✓ | |
| markdown | ✓ | | | |
| mint | | | | `mint` |
@@ -29,9 +38,11 @@
| protobuf | ✓ | | ✓ | |
| python | ✓ | ✓ | ✓ | `pylsp` |
| racket | | | | `racket` |
-| ruby | ✓ | | | `solargraph` |
+| ruby | ✓ | | ✓ | `solargraph` |
| rust | ✓ | ✓ | ✓ | `rust-analyzer` |
+| scala | ✓ | | ✓ | `metals` |
| svelte | ✓ | | ✓ | `svelteserver` |
+| tablegen | ✓ | ✓ | ✓ | |
| toml | ✓ | | | |
| tsq | ✓ | | | |
| tsx | ✓ | | | `typescript-language-server` |
diff --git a/book/src/generated/typable-cmd.md b/book/src/generated/typable-cmd.md
index bb21fd6b..65b2dc5f 100644
--- a/book/src/generated/typable-cmd.md
+++ b/book/src/generated/typable-cmd.md
@@ -20,6 +20,7 @@
| `:quit-all`, `:qa` | Close all views. |
| `:quit-all!`, `:qa!` | Close all views forcefully (ignoring unsaved changes). |
| `:cquit`, `:cq` | Quit with exit code (default 1). Accepts an optional integer exit code (:cq 2). |
+| `:cquit!`, `:cq!` | Quit with exit code (default 1) forcefully (ignoring unsaved changes). Accepts an optional integer exit code (:cq! 2). |
| `:theme` | Change the editor theme. |
| `:clipboard-yank` | Yank main selection into system clipboard. |
| `:clipboard-yank-join` | Yank joined selections into system clipboard. A separator can be provided as first argument. Default value is newline. |
@@ -41,3 +42,6 @@
| `:hsplit`, `:hs`, `:sp` | Open the file in a horizontal split. |
| `:tutor` | Open the tutorial. |
| `:goto`, `:g` | Go to line number. |
+| `:set-option`, `:set` | Set a config option at runtime |
+| `:sort` | Sort ranges in selection. |
+| `:rsort` | Sort ranges in selection in reverse order. |
diff --git a/book/src/guides/adding_languages.md b/book/src/guides/adding_languages.md
index 9ad2c285..5844a48e 100644
--- a/book/src/guides/adding_languages.md
+++ b/book/src/guides/adding_languages.md
@@ -27,22 +27,32 @@ directory](../configuration.md).
These are the available keys and descriptions for the file.
-| Key | Description |
-| ---- | ----------- |
-| name | The name of the language |
-| scope | A string like `source.js` that identifies the language. Currently, we strive to match the scope names used by popular TextMate grammars and by the Linguist library. Usually `source.<name>` or `text.<name>` in case of markup languages |
-| injection-regex | regex pattern that will be tested against a language name in order to determine whether this language should be used for a potential [language injection][treesitter-language-injection] site. |
-| file-types | The filetypes of the language, for example `["yml", "yaml"]` |
-| shebangs | The interpreters from the shebang line, for example `["sh", "bash"]` |
-| roots | A set of marker files to look for when trying to find the workspace root. For example `Cargo.lock`, `yarn.lock` |
-| auto-format | Whether to autoformat this language when saving |
-| comment-token | The token to use as a comment-token |
-| indent | The indent to use. Has sub keys `tab-width` and `unit` |
-| config | Language server configuration |
+| Key | Description |
+| ---- | ----------- |
+| name | The name of the language |
+| scope | A string like `source.js` that identifies the language. Currently, we strive to match the scope names used by popular TextMate grammars and by the Linguist library. Usually `source.<name>` or `text.<name>` in case of markup languages |
+| injection-regex | regex pattern that will be tested against a language name in order to determine whether this language should be used for a potential [language injection][treesitter-language-injection] site. |
+| file-types | The filetypes of the language, for example `["yml", "yaml"]` |
+| shebangs | The interpreters from the shebang line, for example `["sh", "bash"]` |
+| roots | A set of marker files to look for when trying to find the workspace root. For example `Cargo.lock`, `yarn.lock` |
+| auto-format | Whether to autoformat this language when saving |
+| diagnostic-severity | Minimal severity of diagnostic for it to be displayed. (Allowed values: `Error`, `Warning`, `Info`, `Hint`) |
+| comment-token | The token to use as a comment-token |
+| indent | The indent to use. Has sub keys `tab-width` and `unit` |
+| config | Language server configuration |
## Queries
-For a language to have syntax-highlighting and indentation among other things, you have to add queries. Add a directory for your language with the path `runtime/queries/<name>/`. The tree-sitter [website](https://tree-sitter.github.io/tree-sitter/syntax-highlighting#queries) gives more info on how to write queries.
+For a language to have syntax-highlighting and indentation among
+other things, you have to add queries. Add a directory for your
+language with the path `runtime/queries/<name>/`. The tree-sitter
+[website](https://tree-sitter.github.io/tree-sitter/syntax-highlighting#queries)
+gives more info on how to write queries.
+
+> NOTE: When evaluating queries, the first matching query takes
+precedence, which is different from other editors like neovim where
+the last matching query supercedes the ones before it. See
+[this issue][neovim-query-precedence] for an example.
## Common Issues
@@ -58,3 +68,4 @@ For a language to have syntax-highlighting and indentation among other things, y
[treesitter-language-injection]: https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection
[languages.toml]: https://github.com/helix-editor/helix/blob/master/languages.toml
+[neovim-query-precedence]: https://github.com/helix-editor/helix/pull/1170#issuecomment-997294090
diff --git a/book/src/keymap.md b/book/src/keymap.md
index f0a2cb30..70ec13b3 100644
--- a/book/src/keymap.md
+++ b/book/src/keymap.md
@@ -46,39 +46,39 @@
### Changes
-| Key | Description | Command |
-| ----- | ----------- | ------- |
-| `r` | Replace with a character | `replace` |
-| `R` | Replace with yanked text | `replace_with_yanked` |
-| `~` | Switch case of the selected text | `switch_case` |
-| `` ` `` | Set the selected text to lower case | `switch_to_lowercase` |
-| `` Alt-` `` | Set the selected text to upper case | `switch_to_uppercase` |
-| `i` | Insert before selection | `insert_mode` |
-| `a` | Insert after selection (append) | `append_mode` |
-| `I` | Insert at the start of the line | `prepend_to_line` |
-| `A` | Insert at the end of the line | `append_to_line` |
-| `o` | Open new line below selection | `open_below` |
-| `O` | Open new line above selection | `open_above` |
-| `.` | Repeat last change | N/A |
-| `u` | Undo change | `undo` |
-| `U` | Redo change | `redo` |
-| `Alt-u` | Move backward in history | `earlier` |
-| `Alt-U` | Move forward in history | `later` |
-| `y` | Yank selection | `yank` |
-| `p` | Paste after selection | `paste_after` |
-| `P` | Paste before selection | `paste_before` |
-| `"` `<reg>` | Select a register to yank to or paste from | `select_register` |
-| `>` | Indent selection | `indent` |
-| `<` | Unindent selection | `unindent` |
-| `=` | Format selection (currently nonfunctional/disabled) (**LSP**) | `format_selections` |
-| `d` | Delete selection | `delete_selection` |
-| `Alt-d` | Delete selection, without yanking | `delete_selection_noyank` |
-| `c` | Change selection (delete and enter insert mode) | `change_selection` |
-| `Alt-c` | Change selection (delete and enter insert mode, without yanking) | `change_selection_noyank` |
-| `Ctrl-a` | Increment object (number) under cursor | `increment` |
-| `Ctrl-x` | Decrement object (number) under cursor | `decrement` |
-| `q` | Start/stop macro recording to the selected register | `record_macro` |
-| `Q` | Play back a recorded macro from the selected register | `play_macro` |
+| Key | Description | Command |
+| ----- | ----------- | ------- |
+| `r` | Replace with a character | `replace` |
+| `R` | Replace with yanked text | `replace_with_yanked` |
+| `~` | Switch case of the selected text | `switch_case` |
+| `` ` `` | Set the selected text to lower case | `switch_to_lowercase` |
+| `` Alt-` `` | Set the selected text to upper case | `switch_to_uppercase` |
+| `i` | Insert before selection | `insert_mode` |
+| `a` | Insert after selection (append) | `append_mode` |
+| `I` | Insert at the start of the line | `prepend_to_line` |
+| `A` | Insert at the end of the line | `append_to_line` |
+| `o` | Open new line below selection | `open_below` |
+| `O` | Open new line above selection | `open_above` |
+| `.` | Repeat last change | N/A |
+| `u` | Undo change | `undo` |
+| `U` | Redo change | `redo` |
+| `Alt-u` | Move backward in history | `earlier` |
+| `Alt-U` | Move forward in history | `later` |
+| `y` | Yank selection | `yank` |
+| `p` | Paste after selection | `paste_after` |
+| `P` | Paste before selection | `paste_before` |
+| `"` `<reg>` | Select a register to yank to or paste from | `select_register` |
+| `>` | Indent selection | `indent` |
+| `<` | Unindent selection | `unindent` |
+| `=` | Format selection (currently nonfunctional/disabled) (**LSP**) | `format_selections` |
+| `d` | Delete selection | `delete_selection` |
+| `Alt-d` | Delete selection, without yanking | `delete_selection_noyank` |
+| `c` | Change selection (delete and enter insert mode) | `change_selection` |
+| `Alt-c` | Change selection (delete and enter insert mode, without yanking) | `change_selection_noyank` |
+| `Ctrl-a` | Increment object (number) under cursor | `increment` |
+| `Ctrl-x` | Decrement object (number) under cursor | `decrement` |
+| `Q` | Start/stop macro recording to the selected register (experimental) | `record_macro` |
+| `q` | Play back a recorded macro from the selected register (experimental) | `replay_macro` |
#### Shell
@@ -161,7 +161,7 @@ Jumps to various locations.
| Key | Description | Command |
| ----- | ----------- | ------- |
-| `g` | Go to the start of the file | `goto_file_start` |
+| `g` | Go to line number `<n>` else start of file | `goto_file_start` |
| `e` | Go to the end of the file | `goto_last_line` |
| `f` | Go to files in the selection | `goto_file` |
| `h` | Go to the start of the line | `goto_line_start` |
@@ -261,6 +261,8 @@ Mappings in the style of [vim-unimpaired](https://github.com/tpope/vim-unimpaire
| `]D` | Go to last diagnostic in document (**LSP**) | `goto_last_diag` |
| `[space` | Add newline above | `add_newline_above` |
| `]space` | Add newline below | `add_newline_below` |
+| `]o` | Expand syntax tree object selection. | `expand_selection` |
+| `[o` | Shrink syntax tree object selection. | `shrink_selection` |
## Insert Mode
diff --git a/book/src/languages.md b/book/src/languages.md
index cef61501..4c4dc326 100644
--- a/book/src/languages.md
+++ b/book/src/languages.md
@@ -11,4 +11,3 @@ Changes made to the `languages.toml` file in a user's [configuration directory](
name = "rust"
auto-format = false
```
-
diff --git a/book/src/themes.md b/book/src/themes.md
index b6de7002..8eee334b 100644
--- a/book/src/themes.md
+++ b/book/src/themes.md
@@ -105,6 +105,7 @@ We use a similar set of scopes as
- `type` - Types
- `builtin` - Primitive types provided by the language (`int`, `usize`)
+- `constructor`
- `constant` (TODO: constant.other.placeholder for %v)
- `builtin` Special constants provided by the language (`true`, `false`, `nil` etc)
@@ -169,13 +170,20 @@ We use a similar set of scopes as
- `numbered`
- `bold`
- `italic`
- - `underline`
- - `link`
+ - `link`
+ - `url`
+ - `label`
- `quote`
- `raw`
- `inline`
- `block`
+- `diff` - version control changes
+ - `plus` - additions
+ - `minus` - deletions
+ - `delta` - modifications
+ - `moved` - renamed or moved files/changes
+
#### Interface
These scopes are used for theming the editor interface.