mirror of https://github.com/helix-editor/helix
Merge branch 'master' into gix-blame
commit
5d83e93459
|
@ -35,8 +35,8 @@ jobs:
|
|||
uses: actions/cache@v4
|
||||
with:
|
||||
path: runtime/grammars
|
||||
key: ${{ runner.os }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
|
||||
restore-keys: ${{ runner.os }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-
|
||||
key: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
|
||||
restore-keys: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-
|
||||
|
||||
- name: Run cargo check
|
||||
run: cargo check
|
||||
|
@ -65,8 +65,8 @@ jobs:
|
|||
uses: actions/cache@v4
|
||||
with:
|
||||
path: runtime/grammars
|
||||
key: ${{ runner.os }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
|
||||
restore-keys: ${{ runner.os }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-
|
||||
key: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
|
||||
restore-keys: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-
|
||||
|
||||
- name: Run cargo test
|
||||
run: cargo test --workspace
|
||||
|
@ -76,7 +76,7 @@ jobs:
|
|||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm]
|
||||
|
||||
lints:
|
||||
name: Lints
|
||||
|
@ -100,8 +100,8 @@ jobs:
|
|||
uses: actions/cache@v4
|
||||
with:
|
||||
path: runtime/grammars
|
||||
key: ${{ runner.os }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
|
||||
restore-keys: ${{ runner.os }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-
|
||||
key: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
|
||||
restore-keys: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-
|
||||
|
||||
- name: Run cargo fmt
|
||||
run: cargo fmt --all --check
|
||||
|
@ -135,8 +135,8 @@ jobs:
|
|||
uses: actions/cache@v4
|
||||
with:
|
||||
path: runtime/grammars
|
||||
key: ${{ runner.os }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
|
||||
restore-keys: ${{ runner.os }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-
|
||||
key: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
|
||||
restore-keys: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-
|
||||
|
||||
- name: Validate queries
|
||||
run: cargo xtask query-check
|
||||
|
|
|
@ -58,18 +58,18 @@ jobs:
|
|||
strategy:
|
||||
fail-fast: false # don't fail other jobs if one fails
|
||||
matrix:
|
||||
build: [x86_64-linux, x86_64-macos, x86_64-windows] #, x86_64-win-gnu, win32-msvc
|
||||
build: [x86_64-linux, aarch64-linux, x86_64-macos, x86_64-windows] #, x86_64-win-gnu, win32-msvc
|
||||
include:
|
||||
- build: x86_64-linux
|
||||
os: ubuntu-22.04
|
||||
os: ubuntu-24.04
|
||||
rust: stable
|
||||
target: x86_64-unknown-linux-gnu
|
||||
cross: false
|
||||
- build: aarch64-linux
|
||||
os: ubuntu-22.04
|
||||
os: ubuntu-24.04-arm
|
||||
rust: stable
|
||||
target: aarch64-unknown-linux-gnu
|
||||
cross: true
|
||||
cross: false
|
||||
# - build: riscv64-linux
|
||||
# os: ubuntu-22.04
|
||||
# rust: stable
|
||||
|
|
|
@ -41,7 +41,7 @@ tree-sitter = { version = "0.22" }
|
|||
nucleo = "0.5.0"
|
||||
slotmap = "1.0.7"
|
||||
thiserror = "2.0"
|
||||
tempfile = "3.19.0"
|
||||
tempfile = "3.19.1"
|
||||
bitflags = "2.9"
|
||||
unicode-segmentation = "1.2"
|
||||
ropey = { version = "1.6.1", default-features = false, features = ["simd"] }
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
[book]
|
||||
authors = ["Blaž Hrastnik"]
|
||||
language = "en"
|
||||
multilingual = false
|
||||
src = "src"
|
||||
|
||||
[output.html]
|
||||
|
|
|
@ -15,7 +15,9 @@
|
|||
- [Command line](./command-line.md)
|
||||
- [Commands](./commands.md)
|
||||
- [Language support](./lang-support.md)
|
||||
- [Migrating from Vim](./from-vim.md)
|
||||
- [Ecosystem](./ecosystem.md)
|
||||
- [Migrating from Vim](./from-vim.md)
|
||||
- [Helix mode in other software](./other-software.md)
|
||||
- [Configuration](./configuration.md)
|
||||
- [Editor](./editor.md)
|
||||
- [Themes](./themes.md)
|
||||
|
|
|
@ -184,11 +184,11 @@ cargo deb -- --locked
|
|||
> 💡 This locks you into the `--release` profile. But you can also build helix in any way you like.
|
||||
> As long as you leave a `target/release/hx` file, it will get packaged with `cargo deb --no-build`
|
||||
|
||||
> 💡 Don't worry about the repeated
|
||||
> 💡 Don't worry about the following:
|
||||
> ```
|
||||
> warning: Failed to find dependency specification
|
||||
> ```
|
||||
> warnings. Cargo deb just reports which packaged files it didn't derive dependencies for. But
|
||||
> Cargo deb just reports which packaged files it didn't derive dependencies for. But
|
||||
> so far the dependency deriving seams very good, even if some of the grammar files are skipped.
|
||||
|
||||
You can find the resulted `.deb` in `target/debian/`. It should contain everything it needs, including the
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
# Ecosystem
|
||||
|
||||
This section has information related to the wider Helix ecosystem.
|
|
@ -105,6 +105,8 @@ separator = "│"
|
|||
mode.normal = "NORMAL"
|
||||
mode.insert = "INSERT"
|
||||
mode.select = "SELECT"
|
||||
diagnostics = ["warning", "error"]
|
||||
workspace-diagnostics = ["warning", "error"]
|
||||
```
|
||||
The `[editor.statusline]` key takes the following sub-keys:
|
||||
|
||||
|
@ -117,6 +119,8 @@ The `[editor.statusline]` key takes the following sub-keys:
|
|||
| `mode.normal` | The text shown in the `mode` element for normal mode | `"NOR"` |
|
||||
| `mode.insert` | The text shown in the `mode` element for insert mode | `"INS"` |
|
||||
| `mode.select` | The text shown in the `mode` element for select mode | `"SEL"` |
|
||||
| `diagnostics` | A list of severities which are displayed for the current buffer | `["warning", "error"]` |
|
||||
| `workspace-diagnostics` | A list of severities which are displayed for the workspace | `["warning", "error"]` |
|
||||
|
||||
The following statusline elements can be configured:
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
| d | ✓ | ✓ | ✓ | `serve-d` |
|
||||
| dart | ✓ | ✓ | ✓ | `dart` |
|
||||
| dbml | ✓ | | | |
|
||||
| debian | ✓ | | | |
|
||||
| devicetree | ✓ | | | |
|
||||
| dhall | ✓ | ✓ | | `dhall-lsp-server` |
|
||||
| diff | ✓ | | | |
|
||||
|
@ -57,6 +58,7 @@
|
|||
| erb | ✓ | | | |
|
||||
| erlang | ✓ | ✓ | | `erlang_ls`, `elp` |
|
||||
| esdl | ✓ | | | |
|
||||
| fennel | ✓ | | | `fennel-ls` |
|
||||
| fga | ✓ | ✓ | ✓ | |
|
||||
| fidl | ✓ | | | |
|
||||
| fish | ✓ | ✓ | ✓ | `fish-lsp` |
|
||||
|
@ -118,7 +120,7 @@
|
|||
| jsonnet | ✓ | | | `jsonnet-language-server` |
|
||||
| jsx | ✓ | ✓ | ✓ | `typescript-language-server` |
|
||||
| julia | ✓ | ✓ | ✓ | `julia` |
|
||||
| just | ✓ | ✓ | ✓ | |
|
||||
| just | ✓ | ✓ | ✓ | `just-lsp` |
|
||||
| kdl | ✓ | ✓ | ✓ | |
|
||||
| koka | ✓ | | ✓ | `koka` |
|
||||
| kotlin | ✓ | ✓ | ✓ | `kotlin-language-server` |
|
||||
|
@ -175,12 +177,13 @@
|
|||
| ponylang | ✓ | ✓ | ✓ | |
|
||||
| powershell | ✓ | | | |
|
||||
| prisma | ✓ | ✓ | | `prisma-language-server` |
|
||||
| prolog | | | | `swipl` |
|
||||
| prolog | ✓ | | ✓ | `swipl` |
|
||||
| protobuf | ✓ | ✓ | ✓ | `buf`, `pb`, `protols` |
|
||||
| prql | ✓ | | | |
|
||||
| purescript | ✓ | ✓ | | `purescript-language-server` |
|
||||
| python | ✓ | ✓ | ✓ | `ruff`, `jedi-language-server`, `pylsp` |
|
||||
| qml | ✓ | | ✓ | `qmlls` |
|
||||
| quarto | ✓ | | ✓ | |
|
||||
| quint | ✓ | | | `quint-language-server` |
|
||||
| r | ✓ | | | `R` |
|
||||
| racket | ✓ | | ✓ | `racket` |
|
||||
|
@ -248,6 +251,7 @@
|
|||
| wat | ✓ | | | `wat_server` |
|
||||
| webc | ✓ | | | |
|
||||
| werk | ✓ | | | |
|
||||
| wesl | ✓ | ✓ | | |
|
||||
| wgsl | ✓ | | | `wgsl-analyzer` |
|
||||
| wit | ✓ | | ✓ | |
|
||||
| wren | ✓ | ✓ | ✓ | |
|
||||
|
|
|
@ -126,8 +126,10 @@
|
|||
| `add_newline_below` | Add newline below | normal: `` ]<space> ``, select: `` ]<space> `` |
|
||||
| `goto_type_definition` | Goto type definition | normal: `` gy ``, select: `` gy `` |
|
||||
| `goto_implementation` | Goto implementation | normal: `` gi ``, select: `` gi `` |
|
||||
| `goto_file_start` | Goto line number <n> else file start | normal: `` gg ``, select: `` gg `` |
|
||||
| `goto_file_start` | Goto line number <n> else file start | normal: `` gg `` |
|
||||
| `goto_file_end` | Goto file end | |
|
||||
| `extend_to_file_start` | Extend to line number<n> else file start | select: `` gg `` |
|
||||
| `extend_to_file_end` | Extend to file end | |
|
||||
| `goto_file` | Goto files/URLs in selections | normal: `` gf ``, select: `` gf `` |
|
||||
| `goto_file_hsplit` | Goto files in selections (hsplit) | normal: `` <C-w>f ``, `` <space>wf ``, select: `` <C-w>f ``, `` <space>wf `` |
|
||||
| `goto_file_vsplit` | Goto files in selections (vsplit) | normal: `` <C-w>F ``, `` <space>wF ``, select: `` <C-w>F ``, `` <space>wF `` |
|
||||
|
@ -139,7 +141,8 @@
|
|||
| `goto_last_modified_file` | Goto last modified file | normal: `` gm ``, select: `` gm `` |
|
||||
| `goto_last_modification` | Goto last modification | normal: `` g. ``, select: `` g. `` |
|
||||
| `goto_line` | Goto line | normal: `` G ``, select: `` G `` |
|
||||
| `goto_last_line` | Goto last line | normal: `` ge ``, select: `` ge `` |
|
||||
| `goto_last_line` | Goto last line | normal: `` ge `` |
|
||||
| `extend_to_last_line` | Extend to last line | select: `` ge `` |
|
||||
| `goto_first_diag` | Goto first diagnostic | normal: `` [D ``, select: `` [D `` |
|
||||
| `goto_last_diag` | Goto last diagnostic | normal: `` ]D ``, select: `` ]D `` |
|
||||
| `goto_next_diag` | Goto next diagnostic | normal: `` ]d ``, select: `` ]d `` |
|
||||
|
|
|
@ -78,9 +78,9 @@
|
|||
| `:log-open` | Open the helix log file. |
|
||||
| `:insert-output` | Run shell command, inserting output before each selection. |
|
||||
| `:append-output` | Run shell command, appending output after each selection. |
|
||||
| `:pipe` | Pipe each selection to the shell command. |
|
||||
| `:pipe`, `:|` | Pipe each selection to the shell command. |
|
||||
| `:pipe-to` | Pipe each selection to the shell command, ignoring output. |
|
||||
| `:run-shell-command`, `:sh` | Run a shell command |
|
||||
| `:run-shell-command`, `:sh`, `:!` | Run a shell command |
|
||||
| `:reset-diff-change`, `:diffget`, `:diffg` | Reset the diff change at the cursor position. |
|
||||
| `:clear-register` | Clear given register. If no argument is provided, clear all registers. |
|
||||
| `:redraw` | Clear and re-render the whole UI |
|
||||
|
|
|
@ -4,11 +4,16 @@ Writing language injection queries allows one to highlight a specific node as a
|
|||
In addition to the [standard][upstream-docs] language injection options used by tree-sitter, there
|
||||
are a few Helix specific extensions that allow for more control.
|
||||
|
||||
And example of a simple query that would highlight all strings as bash in Nix:
|
||||
An example of a simple query that would highlight all strings as bash in Nix:
|
||||
```scm
|
||||
((string_expression (string_fragment) @injection.content)
|
||||
(#set! injection.language "bash"))
|
||||
```
|
||||
Another example is this query, which highlights links in comments and keywords like "TODO", by reusing the dedicated "comment" language:
|
||||
```
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
```
|
||||
|
||||
## Capture Types
|
||||
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
# Helix mode in other software
|
||||
|
||||
Helix' keymap and interaction model ([Using Helix](#usage.md)) is easier to adopt if it can be used consistently in many editing contexts. Yet, certain use cases cannot easily be addressed directly in Helix. Similar to vim, this leads to the creation of "Helix mode" in various other software products, allowing Helix-style editing for a greater variety of use cases.
|
||||
|
||||
"Helix mode" is frequently still in early stages or missing entirely. For such cases, we also link to relevant bugs or discussions.
|
||||
|
||||
## Other editors
|
||||
|
||||
| Editor | Plugin or feature providing Helix editing | Comments
|
||||
| --- | --- | --- |
|
||||
| [Vim](https://www.vim.org/) | [helix.vim](https://github.com/chtenb/helix.vim) config |
|
||||
| [IntelliJ IDEA](https://www.jetbrains.com/idea/) / [Android Studio](https://developer.android.com/studio)| [IdeaVim](https://plugins.jetbrains.com/plugin/164-ideavim) plugin + [helix.idea.vim](https://github.com/chtenb/helix.vim) config | Minimum recommended version is IdeaVim 2.19.0.
|
||||
| [Visual Studio](https://visualstudio.microsoft.com/) | [VsVim](https://marketplace.visualstudio.com/items?itemName=JaredParMSFT.VsVim) plugin + [helix.vs.vim](https://github.com/chtenb/helix.vim) config |
|
||||
| [Visual Studio Code](https://code.visualstudio.com/) | [Dance](https://marketplace.visualstudio.com/items?itemName=gregoire.dance) extension, or its [Helix fork](https://marketplace.visualstudio.com/items?itemName=kend.dancehelixkey) | The Helix fork has diverged. You can also use the original Dance and tweak its keybindings directly (try [this config](https://github.com/71/dance/issues/299#issuecomment-1655509531)).
|
||||
| [Visual Studio Code](https://code.visualstudio.com/) | [Helix for VS Code](https://marketplace.visualstudio.com/items?itemName=jasew.vscode-helix-emulation) extension|
|
||||
| [Zed](https://zed.dev/) | native via keybindings ([Bug](https://github.com/zed-industries/zed/issues/4642)) |
|
||||
| [CodeMirror](https://codemirror.net/) | [codemirror-helix](https://gitlab.com/_rvidal/codemirror-helix) |
|
||||
|
||||
|
||||
## Shells
|
||||
|
||||
| Shell | Plugin or feature providing Helix editing
|
||||
| --- | ---
|
||||
| Fish | [Feature Request](https://github.com/fish-shell/fish-shell/issues/7748)
|
||||
| Fish | [fish-helix](https://github.com/sshilovsky/fish-helix/tree/main)
|
||||
| Zsh | [helix-zsh](https://github.com/john-h-k/helix-zsh) or [zsh-helix-mode](https://github.com/Multirious/zsh-helix-mode)
|
||||
| Nushell | [Feature Request](https://github.com/nushell/reedline/issues/639)
|
||||
|
||||
## Other software
|
||||
|
||||
| Software | Plugin or feature providing Helix editing. | Comments
|
||||
| --- | --- | --- |
|
||||
| [Obsidian](https://obsidian.md/) | [Obsidian-Helix](https://github.com/Sinono3/obsidian-helix) | Uses `codemirror-helix` listed above.
|
|
@ -12,7 +12,7 @@ There are three kinds of commands that can be used in keymaps:
|
|||
in [`helix-term/src/commands.rs`](https://github.com/helix-editor/helix/blob/master/helix-term/src/commands.rs)
|
||||
at the invocation of `static_commands!` macro.
|
||||
* Typable commands: commands that can be executed from command mode (`:`), for
|
||||
example `:write!`. See the [Commands](./commands.html) documentation for a
|
||||
example `:write!`. See the [Commands](./commands.md) documentation for a
|
||||
list of available typeable commands or the `TypableCommandList` declaration in
|
||||
the source code at [`helix-term/src/commands/typed.rs`](https://github.com/helix-editor/helix/blob/master/helix-term/src/commands/typed.rs).
|
||||
* Macros: sequences of keys that are executed in order. These keybindings
|
||||
|
|
|
@ -181,7 +181,7 @@ We use a similar set of scopes as
|
|||
- `member` - Fields of composite data types (e.g. structs, unions)
|
||||
- `private` - Private fields that use a unique syntax (currently just ECMAScript-based languages)
|
||||
|
||||
- `label`
|
||||
- `label` - `.class`, `#id` in CSS, etc.
|
||||
|
||||
- `punctuation`
|
||||
- `delimiter` - Commas, colons
|
||||
|
@ -216,7 +216,7 @@ We use a similar set of scopes as
|
|||
|
||||
- `namespace`
|
||||
|
||||
- `special`
|
||||
- `special` - `derive` in Rust, etc.
|
||||
|
||||
- `markup`
|
||||
- `heading`
|
||||
|
|
|
@ -86,6 +86,6 @@ Keywords[ru]=текст;текстовый редактор;
|
|||
Keywords[sr]=Текст;едитор;
|
||||
Keywords[tr]=Metin;düzenleyici;
|
||||
Icon=helix
|
||||
Categories=Utility;TextEditor;
|
||||
Categories=Utility;TextEditor;ConsoleOnly
|
||||
StartupNotify=false
|
||||
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
|
||||
|
|
|
@ -75,9 +75,9 @@ in
|
|||
mkdir -p $out/lib
|
||||
installShellCompletion ${./contrib/completion}/hx.{bash,fish,zsh}
|
||||
mkdir -p $out/share/{applications,icons/hicolor/{256x256,scalable}/apps}
|
||||
cp ${./contrib/Helix.desktop} $out/share/applications
|
||||
cp ${./contrib/Helix.desktop} $out/share/applications/Helix.desktop
|
||||
cp ${./logo.svg} $out/share/icons/hicolor/scalable/apps/helix.svg
|
||||
cp ${./contrib/helix.png} $out/share/icons/hicolor/256x256/apps
|
||||
cp ${./contrib/helix.png} $out/share/icons/hicolor/256x256/apps/helix.png
|
||||
'';
|
||||
|
||||
meta.mainProgram = "hx";
|
||||
|
|
|
@ -21,7 +21,7 @@ helix-loader = { path = "../helix-loader" }
|
|||
helix-parsec = { path = "../helix-parsec" }
|
||||
|
||||
ropey.workspace = true
|
||||
smallvec = "1.14"
|
||||
smallvec = "1.15"
|
||||
smartstring = "1.0.1"
|
||||
unicode-segmentation.workspace = true
|
||||
# unicode-width is changing width definitions
|
||||
|
|
|
@ -65,7 +65,7 @@ pub fn print(s: &str) -> (String, Selection) {
|
|||
let head_at_beg = iter.next_if_eq(&"|").is_some();
|
||||
let last_grapheme = |s: &str| {
|
||||
UnicodeSegmentation::graphemes(s, true)
|
||||
.last()
|
||||
.next_back()
|
||||
.map(String::from)
|
||||
};
|
||||
|
||||
|
|
|
@ -23,22 +23,6 @@ pub fn user_lang_config() -> Result<toml::Value, toml::de::Error> {
|
|||
.collect::<Result<Vec<_>, _>>()?
|
||||
.into_iter()
|
||||
.fold(default_lang_config(), |a, b| {
|
||||
// combines for example
|
||||
// b:
|
||||
// [[language]]
|
||||
// name = "toml"
|
||||
// language-server = { command = "taplo", args = ["lsp", "stdio"] }
|
||||
//
|
||||
// a:
|
||||
// [[language]]
|
||||
// language-server = { command = "/usr/bin/taplo" }
|
||||
//
|
||||
// into:
|
||||
// [[language]]
|
||||
// name = "toml"
|
||||
// language-server = { command = "/usr/bin/taplo" }
|
||||
//
|
||||
// thus it overrides the third depth-level of b with values of a if they exist, but otherwise merges their values
|
||||
crate::merge_toml_values(a, b, 3)
|
||||
});
|
||||
|
||||
|
|
|
@ -154,17 +154,36 @@ pub fn default_log_file() -> PathBuf {
|
|||
|
||||
/// Merge two TOML documents, merging values from `right` onto `left`
|
||||
///
|
||||
/// When an array exists in both `left` and `right`, `right`'s array is
|
||||
/// used. When a table exists in both `left` and `right`, the merged table
|
||||
/// consists of all keys in `left`'s table unioned with all keys in `right`
|
||||
/// with the values of `right` being merged recursively onto values of
|
||||
/// `left`.
|
||||
/// `merge_depth` sets the nesting depth up to which values are merged instead
|
||||
/// of overridden.
|
||||
///
|
||||
/// `merge_toplevel_arrays` controls whether a top-level array in the TOML
|
||||
/// document is merged instead of overridden. This is useful for TOML
|
||||
/// documents that use a top-level array of values like the `languages.toml`,
|
||||
/// where one usually wants to override or add to the array instead of
|
||||
/// replacing it altogether.
|
||||
/// When a table exists in both `left` and `right`, the merged table consists of
|
||||
/// all keys in `left`'s table unioned with all keys in `right` with the values
|
||||
/// of `right` being merged recursively onto values of `left`.
|
||||
///
|
||||
/// `crate::merge_toml_values(a, b, 3)` combines, for example:
|
||||
///
|
||||
/// b:
|
||||
/// ```toml
|
||||
/// [[language]]
|
||||
/// name = "toml"
|
||||
/// language-server = { command = "taplo", args = ["lsp", "stdio"] }
|
||||
/// ```
|
||||
/// a:
|
||||
/// ```toml
|
||||
/// [[language]]
|
||||
/// language-server = { command = "/usr/bin/taplo" }
|
||||
/// ```
|
||||
///
|
||||
/// into:
|
||||
/// ```toml
|
||||
/// [[language]]
|
||||
/// name = "toml"
|
||||
/// language-server = { command = "/usr/bin/taplo" }
|
||||
/// ```
|
||||
///
|
||||
/// thus it overrides the third depth-level of b with values of a if they exist,
|
||||
/// but otherwise merges their values
|
||||
pub fn merge_toml_values(left: toml::Value, right: toml::Value, merge_depth: usize) -> toml::Value {
|
||||
use toml::Value;
|
||||
|
||||
|
@ -174,11 +193,6 @@ pub fn merge_toml_values(left: toml::Value, right: toml::Value, merge_depth: usi
|
|||
|
||||
match (left, right) {
|
||||
(Value::Array(mut left_items), Value::Array(right_items)) => {
|
||||
// The top-level arrays should be merged but nested arrays should
|
||||
// act as overrides. For the `languages.toml` config, this means
|
||||
// that you can specify a sub-set of languages in an overriding
|
||||
// `languages.toml` but that nested arrays like Language Server
|
||||
// arguments are replaced instead of merged.
|
||||
if merge_depth > 0 {
|
||||
left_items.reserve(right_items.len());
|
||||
for rvalue in right_items {
|
||||
|
|
|
@ -39,7 +39,7 @@ fn workspace_for_uri(uri: lsp::Url) -> WorkspaceFolder {
|
|||
lsp::WorkspaceFolder {
|
||||
name: uri
|
||||
.path_segments()
|
||||
.and_then(|segments| segments.last())
|
||||
.and_then(|mut segments| segments.next_back())
|
||||
.map(|basename| basename.to_string())
|
||||
.unwrap_or_default(),
|
||||
uri,
|
||||
|
|
|
@ -733,14 +733,17 @@ impl Registry {
|
|||
#[derive(Debug)]
|
||||
pub enum ProgressStatus {
|
||||
Created,
|
||||
Started(lsp::WorkDoneProgress),
|
||||
Started {
|
||||
title: String,
|
||||
progress: lsp::WorkDoneProgress,
|
||||
},
|
||||
}
|
||||
|
||||
impl ProgressStatus {
|
||||
pub fn progress(&self) -> Option<&lsp::WorkDoneProgress> {
|
||||
match &self {
|
||||
ProgressStatus::Created => None,
|
||||
ProgressStatus::Started(progress) => Some(progress),
|
||||
ProgressStatus::Started { title: _, progress } => Some(progress),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -777,6 +780,13 @@ impl LspProgressMap {
|
|||
self.0.get(&id).and_then(|values| values.get(token))
|
||||
}
|
||||
|
||||
pub fn title(&self, id: LanguageServerId, token: &lsp::ProgressToken) -> Option<&String> {
|
||||
self.progress(id, token).and_then(|p| match p {
|
||||
ProgressStatus::Created => None,
|
||||
ProgressStatus::Started { title, .. } => Some(title),
|
||||
})
|
||||
}
|
||||
|
||||
/// Checks if progress `token` for server with `id` is created.
|
||||
pub fn is_created(&mut self, id: LanguageServerId, token: &lsp::ProgressToken) -> bool {
|
||||
self.0
|
||||
|
@ -801,17 +811,39 @@ impl LspProgressMap {
|
|||
self.0.get_mut(&id).and_then(|vals| vals.remove(token))
|
||||
}
|
||||
|
||||
/// Updates the progress of `token` for server with `id` to `status`, returns the value replaced or `None`.
|
||||
/// Updates the progress of `token` for server with `id` to begin state `status`
|
||||
pub fn begin(
|
||||
&mut self,
|
||||
id: LanguageServerId,
|
||||
token: lsp::ProgressToken,
|
||||
status: lsp::WorkDoneProgressBegin,
|
||||
) {
|
||||
self.0.entry(id).or_default().insert(
|
||||
token,
|
||||
ProgressStatus::Started {
|
||||
title: status.title.clone(),
|
||||
progress: lsp::WorkDoneProgress::Begin(status),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// Updates the progress of `token` for server with `id` to report state `status`.
|
||||
pub fn update(
|
||||
&mut self,
|
||||
id: LanguageServerId,
|
||||
token: lsp::ProgressToken,
|
||||
status: lsp::WorkDoneProgress,
|
||||
) -> Option<ProgressStatus> {
|
||||
status: lsp::WorkDoneProgressReport,
|
||||
) {
|
||||
self.0
|
||||
.entry(id)
|
||||
.or_default()
|
||||
.insert(token, ProgressStatus::Started(status))
|
||||
.entry(token)
|
||||
.and_modify(|e| match e {
|
||||
ProgressStatus::Created => (),
|
||||
ProgressStatus::Started { progress, .. } => {
|
||||
*progress = lsp::WorkDoneProgress::Report(status)
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ tokio-stream = "0.1"
|
|||
futures-util = { version = "0.3", features = ["std", "async-await"], default-features = false }
|
||||
arc-swap = { version = "1.7.1" }
|
||||
termini = "1"
|
||||
indexmap = "2.8"
|
||||
indexmap = "2.9"
|
||||
|
||||
# Logging
|
||||
fern = "0.7"
|
||||
|
@ -102,7 +102,7 @@ crossterm = { version = "0.28", features = ["event-stream", "use-dev-tty", "libc
|
|||
helix-loader = { path = "../helix-loader" }
|
||||
|
||||
[dev-dependencies]
|
||||
smallvec = "1.14"
|
||||
smallvec = "1.15"
|
||||
indoc = "2.0.6"
|
||||
tempfile.workspace = true
|
||||
same-file = "1.0.1"
|
||||
|
|
|
@ -761,10 +761,11 @@ impl Application {
|
|||
.compositor
|
||||
.find::<ui::EditorView>()
|
||||
.expect("expected at least one EditorView");
|
||||
let lsp::ProgressParams { token, value } = params;
|
||||
|
||||
let lsp::ProgressParamsValue::WorkDone(work) = value;
|
||||
let parts = match &work {
|
||||
let lsp::ProgressParams {
|
||||
token,
|
||||
value: lsp::ProgressParamsValue::WorkDone(work),
|
||||
} = params;
|
||||
let (title, message, percentage) = match &work {
|
||||
lsp::WorkDoneProgress::Begin(lsp::WorkDoneProgressBegin {
|
||||
title,
|
||||
message,
|
||||
|
@ -792,47 +793,43 @@ impl Application {
|
|||
}
|
||||
};
|
||||
|
||||
let token_d: &dyn std::fmt::Display = match &token {
|
||||
lsp::NumberOrString::Number(n) => n,
|
||||
lsp::NumberOrString::String(s) => s,
|
||||
};
|
||||
|
||||
let status = match parts {
|
||||
(Some(title), Some(message), Some(percentage)) => {
|
||||
format!("[{}] {}% {} - {}", token_d, percentage, title, message)
|
||||
if self.editor.config().lsp.display_progress_messages {
|
||||
let title =
|
||||
title.or_else(|| self.lsp_progress.title(server_id, &token));
|
||||
if title.is_some() || percentage.is_some() || message.is_some() {
|
||||
use std::fmt::Write as _;
|
||||
let mut status = format!("{}: ", language_server!().name());
|
||||
if let Some(percentage) = percentage {
|
||||
write!(status, "{percentage:>2}% ").unwrap();
|
||||
}
|
||||
if let Some(title) = title {
|
||||
status.push_str(title);
|
||||
}
|
||||
if title.is_some() && message.is_some() {
|
||||
status.push_str(" ⋅ ");
|
||||
}
|
||||
if let Some(message) = message {
|
||||
status.push_str(message);
|
||||
}
|
||||
self.editor.set_status(status);
|
||||
}
|
||||
(Some(title), None, Some(percentage)) => {
|
||||
format!("[{}] {}% {}", token_d, percentage, title)
|
||||
}
|
||||
(Some(title), Some(message), None) => {
|
||||
format!("[{}] {} - {}", token_d, title, message)
|
||||
}
|
||||
(None, Some(message), Some(percentage)) => {
|
||||
format!("[{}] {}% {}", token_d, percentage, message)
|
||||
}
|
||||
(Some(title), None, None) => {
|
||||
format!("[{}] {}", token_d, title)
|
||||
}
|
||||
(None, Some(message), None) => {
|
||||
format!("[{}] {}", token_d, message)
|
||||
}
|
||||
(None, None, Some(percentage)) => {
|
||||
format!("[{}] {}%", token_d, percentage)
|
||||
}
|
||||
(None, None, None) => format!("[{}]", token_d),
|
||||
};
|
||||
|
||||
if let lsp::WorkDoneProgress::End(_) = work {
|
||||
self.lsp_progress.end_progress(server_id, &token);
|
||||
if !self.lsp_progress.is_progressing(server_id) {
|
||||
editor_view.spinners_mut().get_or_create(server_id).stop();
|
||||
}
|
||||
} else {
|
||||
self.lsp_progress.update(server_id, token, work);
|
||||
}
|
||||
|
||||
if self.config.load().editor.lsp.display_progress_messages {
|
||||
self.editor.set_status(status);
|
||||
match work {
|
||||
lsp::WorkDoneProgress::Begin(begin_status) => {
|
||||
self.lsp_progress
|
||||
.begin(server_id, token.clone(), begin_status);
|
||||
}
|
||||
lsp::WorkDoneProgress::Report(report_status) => {
|
||||
self.lsp_progress
|
||||
.update(server_id, token.clone(), report_status);
|
||||
}
|
||||
lsp::WorkDoneProgress::End(_) => {
|
||||
self.lsp_progress.end_progress(server_id, &token);
|
||||
if !self.lsp_progress.is_progressing(server_id) {
|
||||
editor_view.spinners_mut().get_or_create(server_id).stop();
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Notification::ProgressMessage(_params) => {
|
||||
|
|
|
@ -427,6 +427,8 @@ impl MappableCommand {
|
|||
goto_implementation, "Goto implementation",
|
||||
goto_file_start, "Goto line number <n> else file start",
|
||||
goto_file_end, "Goto file end",
|
||||
extend_to_file_start, "Extend to line number<n> else file start",
|
||||
extend_to_file_end, "Extend to file end",
|
||||
goto_file, "Goto files/URLs in selections",
|
||||
goto_file_hsplit, "Goto files in selections (hsplit)",
|
||||
goto_file_vsplit, "Goto files in selections (vsplit)",
|
||||
|
@ -439,6 +441,7 @@ impl MappableCommand {
|
|||
goto_last_modification, "Goto last modification",
|
||||
goto_line, "Goto line",
|
||||
goto_last_line, "Goto last line",
|
||||
extend_to_last_line, "Extend to last line",
|
||||
goto_first_diag, "Goto first diagnostic",
|
||||
goto_last_diag, "Goto last diagnostic",
|
||||
goto_next_diag, "Goto next diagnostic",
|
||||
|
@ -1255,28 +1258,44 @@ fn goto_next_paragraph(cx: &mut Context) {
|
|||
}
|
||||
|
||||
fn goto_file_start(cx: &mut Context) {
|
||||
goto_file_start_impl(cx, Movement::Move);
|
||||
}
|
||||
|
||||
fn extend_to_file_start(cx: &mut Context) {
|
||||
goto_file_start_impl(cx, Movement::Extend);
|
||||
}
|
||||
|
||||
fn goto_file_start_impl(cx: &mut Context, movement: Movement) {
|
||||
if cx.count.is_some() {
|
||||
goto_line(cx);
|
||||
goto_line_impl(cx, movement);
|
||||
} else {
|
||||
let (view, doc) = current!(cx.editor);
|
||||
let text = doc.text().slice(..);
|
||||
let selection = doc
|
||||
.selection(view.id)
|
||||
.clone()
|
||||
.transform(|range| range.put_cursor(text, 0, cx.editor.mode == Mode::Select));
|
||||
.transform(|range| range.put_cursor(text, 0, movement == Movement::Extend));
|
||||
push_jump(view, doc);
|
||||
doc.set_selection(view.id, selection);
|
||||
}
|
||||
}
|
||||
|
||||
fn goto_file_end(cx: &mut Context) {
|
||||
goto_file_end_impl(cx, Movement::Move);
|
||||
}
|
||||
|
||||
fn extend_to_file_end(cx: &mut Context) {
|
||||
goto_file_end_impl(cx, Movement::Extend)
|
||||
}
|
||||
|
||||
fn goto_file_end_impl(cx: &mut Context, movement: Movement) {
|
||||
let (view, doc) = current!(cx.editor);
|
||||
let text = doc.text().slice(..);
|
||||
let pos = doc.text().len_chars();
|
||||
let selection = doc
|
||||
.selection(view.id)
|
||||
.clone()
|
||||
.transform(|range| range.put_cursor(text, pos, cx.editor.mode == Mode::Select));
|
||||
.transform(|range| range.put_cursor(text, pos, movement == Movement::Extend));
|
||||
push_jump(view, doc);
|
||||
doc.set_selection(view.id, selection);
|
||||
}
|
||||
|
@ -3799,15 +3818,23 @@ fn push_jump(view: &mut View, doc: &Document) {
|
|||
}
|
||||
|
||||
fn goto_line(cx: &mut Context) {
|
||||
goto_line_impl(cx, Movement::Move);
|
||||
}
|
||||
|
||||
fn goto_line_impl(cx: &mut Context, movement: Movement) {
|
||||
if cx.count.is_some() {
|
||||
let (view, doc) = current!(cx.editor);
|
||||
push_jump(view, doc);
|
||||
|
||||
goto_line_without_jumplist(cx.editor, cx.count);
|
||||
goto_line_without_jumplist(cx.editor, cx.count, movement);
|
||||
}
|
||||
}
|
||||
|
||||
fn goto_line_without_jumplist(editor: &mut Editor, count: Option<NonZeroUsize>) {
|
||||
fn goto_line_without_jumplist(
|
||||
editor: &mut Editor,
|
||||
count: Option<NonZeroUsize>,
|
||||
movement: Movement,
|
||||
) {
|
||||
if let Some(count) = count {
|
||||
let (view, doc) = current!(editor);
|
||||
let text = doc.text().slice(..);
|
||||
|
@ -3822,13 +3849,21 @@ fn goto_line_without_jumplist(editor: &mut Editor, count: Option<NonZeroUsize>)
|
|||
let selection = doc
|
||||
.selection(view.id)
|
||||
.clone()
|
||||
.transform(|range| range.put_cursor(text, pos, editor.mode == Mode::Select));
|
||||
.transform(|range| range.put_cursor(text, pos, movement == Movement::Extend));
|
||||
|
||||
doc.set_selection(view.id, selection);
|
||||
}
|
||||
}
|
||||
|
||||
fn goto_last_line(cx: &mut Context) {
|
||||
goto_last_line_impl(cx, Movement::Move)
|
||||
}
|
||||
|
||||
fn extend_to_last_line(cx: &mut Context) {
|
||||
goto_last_line_impl(cx, Movement::Extend)
|
||||
}
|
||||
|
||||
fn goto_last_line_impl(cx: &mut Context, movement: Movement) {
|
||||
let (view, doc) = current!(cx.editor);
|
||||
let text = doc.text().slice(..);
|
||||
let line_idx = if text.line(text.len_lines() - 1).len_chars() == 0 {
|
||||
|
@ -3841,7 +3876,7 @@ fn goto_last_line(cx: &mut Context) {
|
|||
let selection = doc
|
||||
.selection(view.id)
|
||||
.clone()
|
||||
.transform(|range| range.put_cursor(text, pos, cx.editor.mode == Mode::Select));
|
||||
.transform(|range| range.put_cursor(text, pos, movement == Movement::Extend));
|
||||
|
||||
push_jump(view, doc);
|
||||
doc.set_selection(view.id, selection);
|
||||
|
|
|
@ -1914,7 +1914,15 @@ fn update_goto_line_number_preview(cx: &mut compositor::Context, args: Args) ->
|
|||
|
||||
let scrolloff = cx.editor.config().scrolloff;
|
||||
let line = args[0].parse::<usize>()?;
|
||||
goto_line_without_jumplist(cx.editor, NonZeroUsize::new(line));
|
||||
goto_line_without_jumplist(
|
||||
cx.editor,
|
||||
NonZeroUsize::new(line),
|
||||
if cx.editor.mode == Mode::Select {
|
||||
Movement::Extend
|
||||
} else {
|
||||
Movement::Move
|
||||
},
|
||||
);
|
||||
|
||||
let (view, doc) = current!(cx.editor);
|
||||
view.ensure_cursor_in_view(doc, scrolloff);
|
||||
|
@ -2958,7 +2966,7 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
|
|||
fun: theme,
|
||||
completer: CommandCompleter::positional(&[completers::theme]),
|
||||
signature: Signature {
|
||||
positionals: (1, Some(1)),
|
||||
positionals: (0, Some(1)),
|
||||
..Signature::DEFAULT
|
||||
},
|
||||
},
|
||||
|
@ -3476,7 +3484,7 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
|
|||
},
|
||||
TypableCommand {
|
||||
name: "pipe",
|
||||
aliases: &[],
|
||||
aliases: &["|"],
|
||||
doc: "Pipe each selection to the shell command.",
|
||||
fun: pipe,
|
||||
completer: SHELL_COMPLETER,
|
||||
|
@ -3492,7 +3500,7 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
|
|||
},
|
||||
TypableCommand {
|
||||
name: "run-shell-command",
|
||||
aliases: &["sh"],
|
||||
aliases: &["sh", "!"],
|
||||
doc: "Run a shell command",
|
||||
fun: run_shell_command,
|
||||
completer: SHELL_COMPLETER,
|
||||
|
|
|
@ -167,10 +167,14 @@ pub(super) fn register_hooks(handlers: &Handlers) {
|
|||
apply_color_swatch_changes(color_swatches_padding);
|
||||
}
|
||||
|
||||
// Cancel the ongoing request, if present.
|
||||
event.doc.color_swatch_controller.cancel();
|
||||
|
||||
helix_event::send_blocking(&tx, DocumentColorsEvent(event.doc.id()));
|
||||
// Avoid re-requesting document colors if the change is a ghost transaction (completion)
|
||||
// because the language server will not know about the updates to the document and will
|
||||
// give out-of-date locations.
|
||||
if !event.ghost_transaction {
|
||||
// Cancel the ongoing request, if present.
|
||||
event.doc.color_swatch_controller.cancel();
|
||||
helix_event::send_blocking(&tx, DocumentColorsEvent(event.doc.id()));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
});
|
||||
|
|
|
@ -368,6 +368,8 @@ pub fn default() -> HashMap<Mode, KeyTrie> {
|
|||
|
||||
"v" => normal_mode,
|
||||
"g" => { "Goto"
|
||||
"g" => extend_to_file_start,
|
||||
"e" => extend_to_last_line,
|
||||
"k" => extend_line_up,
|
||||
"j" => extend_line_down,
|
||||
"w" => extend_to_word,
|
||||
|
|
|
@ -90,7 +90,7 @@ macro_rules! keymap {
|
|||
};
|
||||
|
||||
(@trie [$($cmd:ident),* $(,)?]) => {
|
||||
$crate::keymap::KeyTrie::Sequence(vec![$($crate::commands::Command::$cmd),*])
|
||||
$crate::keymap::KeyTrie::Sequence(vec![$($crate::commands::MappableCommand::$cmd),*])
|
||||
};
|
||||
|
||||
(
|
||||
|
|
|
@ -732,7 +732,7 @@ impl Component for Prompt {
|
|||
fn cursor(&self, area: Rect, editor: &Editor) -> (Option<Position>, CursorKind) {
|
||||
let area = area
|
||||
.clip_left(self.prompt.len() as u16)
|
||||
.clip_right(if self.prompt.len() > 0 { 0 } else { 2 });
|
||||
.clip_right(if self.prompt.is_empty() { 2 } else { 0 });
|
||||
|
||||
let anchor = self.anchor.min(self.line.len().saturating_sub(1));
|
||||
let mut col = area.left() as usize
|
||||
|
|
|
@ -226,36 +226,58 @@ fn render_diagnostics<F>(context: &mut RenderContext, write: F)
|
|||
where
|
||||
F: Fn(&mut RenderContext, String, Option<Style>) + Copy,
|
||||
{
|
||||
let (warnings, errors) = context
|
||||
.doc
|
||||
.diagnostics()
|
||||
.iter()
|
||||
.fold((0, 0), |mut counts, diag| {
|
||||
use helix_core::diagnostic::Severity;
|
||||
match diag.severity {
|
||||
Some(Severity::Warning) => counts.0 += 1,
|
||||
Some(Severity::Error) | None => counts.1 += 1,
|
||||
_ => {}
|
||||
use helix_core::diagnostic::Severity;
|
||||
let (hints, info, warnings, errors) =
|
||||
context
|
||||
.doc
|
||||
.diagnostics()
|
||||
.iter()
|
||||
.fold((0, 0, 0, 0), |mut counts, diag| {
|
||||
match diag.severity {
|
||||
Some(Severity::Hint) | None => counts.0 += 1,
|
||||
Some(Severity::Info) => counts.1 += 1,
|
||||
Some(Severity::Warning) => counts.2 += 1,
|
||||
Some(Severity::Error) => counts.3 += 1,
|
||||
}
|
||||
counts
|
||||
});
|
||||
|
||||
for sev in &context.editor.config().statusline.diagnostics {
|
||||
match sev {
|
||||
Severity::Hint if hints > 0 => {
|
||||
write(
|
||||
context,
|
||||
"●".to_string(),
|
||||
Some(context.editor.theme.get("hint")),
|
||||
);
|
||||
write(context, format!(" {} ", hints), None);
|
||||
}
|
||||
counts
|
||||
});
|
||||
|
||||
if warnings > 0 {
|
||||
write(
|
||||
context,
|
||||
"●".to_string(),
|
||||
Some(context.editor.theme.get("warning")),
|
||||
);
|
||||
write(context, format!(" {} ", warnings), None);
|
||||
}
|
||||
|
||||
if errors > 0 {
|
||||
write(
|
||||
context,
|
||||
"●".to_string(),
|
||||
Some(context.editor.theme.get("error")),
|
||||
);
|
||||
write(context, format!(" {} ", errors), None);
|
||||
Severity::Info if info > 0 => {
|
||||
write(
|
||||
context,
|
||||
"●".to_string(),
|
||||
Some(context.editor.theme.get("info")),
|
||||
);
|
||||
write(context, format!(" {} ", info), None);
|
||||
}
|
||||
Severity::Warning if warnings > 0 => {
|
||||
write(
|
||||
context,
|
||||
"●".to_string(),
|
||||
Some(context.editor.theme.get("warning")),
|
||||
);
|
||||
write(context, format!(" {} ", warnings), None);
|
||||
}
|
||||
Severity::Error if errors > 0 => {
|
||||
write(
|
||||
context,
|
||||
"●".to_string(),
|
||||
Some(context.editor.theme.get("error")),
|
||||
);
|
||||
write(context, format!(" {} ", errors), None);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -263,41 +285,61 @@ fn render_workspace_diagnostics<F>(context: &mut RenderContext, write: F)
|
|||
where
|
||||
F: Fn(&mut RenderContext, String, Option<Style>) + Copy,
|
||||
{
|
||||
let (warnings, errors) =
|
||||
context
|
||||
.editor
|
||||
.diagnostics
|
||||
.values()
|
||||
.flatten()
|
||||
.fold((0, 0), |mut counts, (diag, _)| {
|
||||
match diag.severity {
|
||||
Some(DiagnosticSeverity::WARNING) => counts.0 += 1,
|
||||
Some(DiagnosticSeverity::ERROR) | None => counts.1 += 1,
|
||||
_ => {}
|
||||
}
|
||||
counts
|
||||
});
|
||||
use helix_core::diagnostic::Severity;
|
||||
let (hints, info, warnings, errors) = context.editor.diagnostics.values().flatten().fold(
|
||||
(0, 0, 0, 0),
|
||||
|mut counts, (diag, _)| {
|
||||
match diag.severity {
|
||||
Some(DiagnosticSeverity::HINT) | None => counts.0 += 1,
|
||||
Some(DiagnosticSeverity::INFORMATION) => counts.1 += 1,
|
||||
Some(DiagnosticSeverity::WARNING) => counts.2 += 1,
|
||||
Some(DiagnosticSeverity::ERROR) => counts.3 += 1,
|
||||
_ => {}
|
||||
}
|
||||
counts
|
||||
},
|
||||
);
|
||||
|
||||
if warnings > 0 || errors > 0 {
|
||||
if hints > 0 || info > 0 || warnings > 0 || errors > 0 {
|
||||
write(context, " W ".into(), None);
|
||||
}
|
||||
|
||||
if warnings > 0 {
|
||||
write(
|
||||
context,
|
||||
"●".to_string(),
|
||||
Some(context.editor.theme.get("warning")),
|
||||
);
|
||||
write(context, format!(" {} ", warnings), None);
|
||||
}
|
||||
|
||||
if errors > 0 {
|
||||
write(
|
||||
context,
|
||||
"●".to_string(),
|
||||
Some(context.editor.theme.get("error")),
|
||||
);
|
||||
write(context, format!(" {} ", errors), None);
|
||||
for sev in &context.editor.config().statusline.workspace_diagnostics {
|
||||
match sev {
|
||||
Severity::Hint if hints > 0 => {
|
||||
write(
|
||||
context,
|
||||
"●".to_string(),
|
||||
Some(context.editor.theme.get("hint")),
|
||||
);
|
||||
write(context, format!(" {} ", hints), None);
|
||||
}
|
||||
Severity::Info if info > 0 => {
|
||||
write(
|
||||
context,
|
||||
"●".to_string(),
|
||||
Some(context.editor.theme.get("info")),
|
||||
);
|
||||
write(context, format!(" {} ", info), None);
|
||||
}
|
||||
Severity::Warning if warnings > 0 => {
|
||||
write(
|
||||
context,
|
||||
"●".to_string(),
|
||||
Some(context.editor.theme.get("warning")),
|
||||
);
|
||||
write(context, format!(" {} ", warnings), None);
|
||||
}
|
||||
Severity::Error if errors > 0 => {
|
||||
write(
|
||||
context,
|
||||
"●".to_string(),
|
||||
Some(context.editor.theme.get("error")),
|
||||
);
|
||||
write(context, format!(" {} ", errors), None);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ tokio = { version = "1", features = ["rt", "rt-multi-thread", "time", "sync", "p
|
|||
parking_lot.workspace = true
|
||||
arc-swap = { version = "1.7.1" }
|
||||
|
||||
gix = { version = "0.70.0", features = ["attributes", "status", "blame", "parallel"], default-features = false, optional = true }
|
||||
gix = { version = "0.71.0", features = ["attributes", "status", "blame", "parallel"], default-features = false, optional = true }
|
||||
imara-diff = "0.1.8"
|
||||
anyhow = "1"
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ pub fn get_diff_base(file: &Path) -> Result<Vec<u8>> {
|
|||
let data = file_object.detach().data;
|
||||
// Get the actual data that git would make out of the git object.
|
||||
// This will apply the user's git config or attributes like crlf conversions.
|
||||
if let Some(work_dir) = repo.work_dir() {
|
||||
if let Some(work_dir) = repo.workdir() {
|
||||
let rela_path = file.strip_prefix(work_dir)?;
|
||||
let rela_path = gix::path::try_into_bstr(rela_path)?;
|
||||
let (mut pipeline, _) = repo.filter_pipeline(None)?;
|
||||
|
@ -130,7 +130,7 @@ fn open_repo(path: &Path) -> Result<ThreadSafeRepository> {
|
|||
/// Emulates the result of running `git status` from the command line.
|
||||
fn status(repo: &Repository, f: impl Fn(Result<FileChange>) -> bool) -> Result<()> {
|
||||
let work_dir = repo
|
||||
.work_dir()
|
||||
.workdir()
|
||||
.ok_or_else(|| anyhow::anyhow!("working tree not found"))?
|
||||
.to_path_buf();
|
||||
|
||||
|
@ -197,7 +197,7 @@ fn status(repo: &Repository, f: impl Fn(Result<FileChange>) -> bool) -> Result<(
|
|||
|
||||
/// Finds the object that contains the contents of a file at a specific commit.
|
||||
fn find_file_in_commit(repo: &Repository, commit: &Commit, file: &Path) -> Result<ObjectId> {
|
||||
let repo_dir = repo.work_dir().context("repo has no worktree")?;
|
||||
let repo_dir = repo.workdir().context("repo has no worktree")?;
|
||||
let rel_path = file.strip_prefix(repo_dir)?;
|
||||
let tree = commit.tree()?;
|
||||
let tree_entry = tree
|
||||
|
|
|
@ -881,7 +881,7 @@ impl Document {
|
|||
} else if !output.stderr.is_empty() {
|
||||
log::debug!(
|
||||
"Formatter printed to stderr: {}",
|
||||
String::from_utf8_lossy(&output.stderr).to_string()
|
||||
String::from_utf8_lossy(&output.stderr)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -542,6 +542,8 @@ pub struct StatusLineConfig {
|
|||
pub right: Vec<StatusLineElement>,
|
||||
pub separator: String,
|
||||
pub mode: ModeConfig,
|
||||
pub diagnostics: Vec<Severity>,
|
||||
pub workspace_diagnostics: Vec<Severity>,
|
||||
}
|
||||
|
||||
impl Default for StatusLineConfig {
|
||||
|
@ -566,6 +568,8 @@ impl Default for StatusLineConfig {
|
|||
],
|
||||
separator: String::from("│"),
|
||||
mode: ModeConfig::default(),
|
||||
diagnostics: vec![Severity::Warning, Severity::Error],
|
||||
workspace_diagnostics: vec![Severity::Warning, Severity::Error],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1857,7 +1861,7 @@ impl Editor {
|
|||
}
|
||||
|
||||
pub fn close_document(&mut self, doc_id: DocumentId, force: bool) -> Result<(), CloseError> {
|
||||
let doc = match self.documents.remove(&doc_id) {
|
||||
let doc = match self.documents.get(&doc_id) {
|
||||
Some(doc) => doc,
|
||||
None => return Err(CloseError::DoesNotExist),
|
||||
};
|
||||
|
@ -1904,6 +1908,8 @@ impl Editor {
|
|||
}
|
||||
}
|
||||
|
||||
let doc = self.documents.remove(&doc_id).unwrap();
|
||||
|
||||
// If the document we removed was visible in all views, we will have no more views. We don't
|
||||
// want to close the editor just for a simple buffer close, so we need to create a new view
|
||||
// containing either an existing document, or a brand new document.
|
||||
|
|
|
@ -145,7 +145,8 @@ impl Registers {
|
|||
}
|
||||
|
||||
pub fn last<'a>(&'a self, name: char, editor: &'a Editor) -> Option<Cow<'a, str>> {
|
||||
self.read(name, editor).and_then(|values| values.last())
|
||||
self.read(name, editor)
|
||||
.and_then(|mut values| values.next_back())
|
||||
}
|
||||
|
||||
pub fn iter_preview(&self) -> impl Iterator<Item = (char, &str)> {
|
||||
|
|
|
@ -39,6 +39,7 @@ elm-language-server = { command = "elm-language-server" }
|
|||
elp = { command = "elp", args = ["server"] }
|
||||
elvish = { command = "elvish", args = ["-lsp"] }
|
||||
erlang-ls = { command = "erlang_ls" }
|
||||
fennel-ls = { command = "fennel-ls" }
|
||||
fish-lsp = { command = "fish-lsp", args = ["start"], environment = { fish_lsp_show_client_popups = "false" } }
|
||||
forc = { command = "forc", args = ["lsp"] }
|
||||
forth-lsp = { command = "forth-lsp" }
|
||||
|
@ -57,6 +58,7 @@ jedi = { command = "jedi-language-server" }
|
|||
jq-lsp = { command = "jq-lsp" }
|
||||
jsonnet-language-server = { command = "jsonnet-language-server", args= ["-t", "--lint"] }
|
||||
julia = { command = "julia", timeout = 60, args = [ "--startup-file=no", "--history-file=no", "--quiet", "-e", "using LanguageServer; runserver()", ] }
|
||||
just-lsp = { command = "just-lsp" }
|
||||
koka = { command = "koka", args = ["--language-server", "--lsstdio"] }
|
||||
koto-ls = { command = "koto-ls" }
|
||||
kotlin-language-server = { command = "kotlin-language-server" }
|
||||
|
@ -68,7 +70,7 @@ markdown-oxide = { command = "markdown-oxide" }
|
|||
marksman = { command = "marksman", args = ["server"] }
|
||||
metals = { command = "metals", config = { "isHttpEnabled" = true, metals = { inlayHints = { typeParameters = {enable = true} , hintsInPatternMatch = {enable = true} } } } }
|
||||
mesonlsp = { command = "mesonlsp", args = ["--lsp"] }
|
||||
mint = { command = "mint", args = ["ls"] }
|
||||
mint = { command = "mint", args = ["tool", "ls"] }
|
||||
mojo-lsp = { command = "magic", args = ["run", "mojo-lsp-server"] }
|
||||
nil = { command = "nil" }
|
||||
nimlangserver = { command = "nimlangserver" }
|
||||
|
@ -175,7 +177,7 @@ rangeVariableTypes = true
|
|||
command = "golangci-lint-langserver"
|
||||
|
||||
[language-server.golangci-lint-lsp.config]
|
||||
command = ["golangci-lint", "run", "--out-format", "json", "--issues-exit-code=1"]
|
||||
command = ["golangci-lint", "run", "--output.json.path=stdout", "--show-stats=false", "--issues-exit-code=1"]
|
||||
|
||||
|
||||
[language-server.rust-analyzer]
|
||||
|
@ -396,6 +398,20 @@ indent = { tab-width = 2, unit = " " }
|
|||
name = "elixir"
|
||||
source = { git = "https://github.com/elixir-lang/tree-sitter-elixir", rev = "02a6f7fd4be28dd94ee4dd2ca19cb777053ea74e" }
|
||||
|
||||
[[language]]
|
||||
name = "fennel"
|
||||
scope = "source.fennel"
|
||||
file-types = ["fnl", "fnlm"]
|
||||
shebangs = ["fennel"]
|
||||
comment-token = ";"
|
||||
language-servers = ["fennel-ls"]
|
||||
formatter = { command = "fnlfmt", args = ["-"]}
|
||||
indent = { tab-width = 2, unit = " " }
|
||||
|
||||
[[grammar]]
|
||||
name = "fennel"
|
||||
source = { git = "https://github.com/alexmozaidze/tree-sitter-fennel", rev = "cfbfa478dc2dbef267ee94ae4323d9c886f45e94" }
|
||||
|
||||
[[language]]
|
||||
name = "fish"
|
||||
scope = "source.fish"
|
||||
|
@ -1500,6 +1516,10 @@ comment-token = "%"
|
|||
block-comment-tokens = { start = "/*", end = "*/" }
|
||||
language-servers = [ "swipl" ]
|
||||
|
||||
[[grammar]]
|
||||
name = "prolog"
|
||||
source = { git = "https://codeberg.org/foxy/tree-sitter-prolog", subpath = "grammars/prolog", rev = "d8d415f6a1cf80ca138524bcc395810b176d40fa" }
|
||||
|
||||
[[language]]
|
||||
name = "tsq"
|
||||
scope = "source.tsq"
|
||||
|
@ -1620,6 +1640,18 @@ injection-regex = "comment"
|
|||
name = "comment"
|
||||
source = { git = "https://github.com/stsewd/tree-sitter-comment", rev = "aefcc2813392eb6ffe509aa0fc8b4e9b57413ee1" }
|
||||
|
||||
[[language]]
|
||||
name = "wesl"
|
||||
scope = "source.wesl"
|
||||
file-types = ["wesl"]
|
||||
comment-token = "//"
|
||||
block-comment-tokens = { start = "/*", end = "*/" }
|
||||
indent = { tab-width = 4, unit = " " }
|
||||
|
||||
[[grammar]]
|
||||
name = "wesl"
|
||||
source = { git = "https://github.com/wgsl-tooling-wg/tree-sitter-wesl", rev = "94ee6122680ef8ce2173853ca7c99f7aaeeda8ce" }
|
||||
|
||||
[[language]]
|
||||
name = "wgsl"
|
||||
scope = "source.wgsl"
|
||||
|
@ -2030,6 +2062,16 @@ auto-format = true
|
|||
name = "gleam"
|
||||
source = { git = "https://github.com/gleam-lang/tree-sitter-gleam", rev = "426e67087fd62be5f4533581b5916b2cf010fb5b" }
|
||||
|
||||
[[language]]
|
||||
name = "quarto"
|
||||
scope = "source.qmd"
|
||||
language-id = "qmd"
|
||||
injection-regex = "qmd"
|
||||
file-types = ["qmd"]
|
||||
indent = { tab-width = 2, unit = " " }
|
||||
grammar = "markdown"
|
||||
block-comment-tokens = { start = "<!--", end = "-->" }
|
||||
|
||||
[[language]]
|
||||
name = "ron"
|
||||
scope = "source.ron"
|
||||
|
@ -2782,6 +2824,7 @@ file-types = [
|
|||
"rng",
|
||||
"shproj",
|
||||
"tld",
|
||||
{ glob = "*.tm[Tt]heme" },
|
||||
"tmx",
|
||||
"vbproj.user",
|
||||
"vcxproj",
|
||||
|
@ -3270,6 +3313,7 @@ file-types = ["just", { glob = "justfile" }, { glob = "Justfile" }, { glob = ".j
|
|||
injection-regex = "just"
|
||||
comment-token = "#"
|
||||
indent = { tab-width = 4, unit = " " }
|
||||
language-servers = ["just-lsp"]
|
||||
# auto-format = true
|
||||
# formatter = { command = "just", args = ["--dump"] } # Please see: https://github.com/helix-editor/helix/issues/9703
|
||||
|
||||
|
@ -3409,7 +3453,7 @@ text-width = 72
|
|||
|
||||
[[grammar]]
|
||||
name = "jjdescription"
|
||||
source = { git = "https://github.com/kareigu/tree-sitter-jjdescription", rev = "d09205b52b5a0165b588a793e366c1116468d86f" }
|
||||
source = { git = "https://github.com/kareigu/tree-sitter-jjdescription", rev = "1613b8c85b6ead48464d73668f39910dcbb41911" }
|
||||
|
||||
[[language]]
|
||||
name = "jq"
|
||||
|
@ -4254,3 +4298,18 @@ indent = { tab-width = 2, unit = " " }
|
|||
[[grammar]]
|
||||
name = "werk"
|
||||
source = { git = "https://github.com/little-bonsai/tree-sitter-werk", rev = "92b0f7fe98465c4c435794a58e961306193d1c1e" }
|
||||
|
||||
[[language]]
|
||||
name = "debian"
|
||||
scope = "text.debian"
|
||||
file-types = [
|
||||
"dsc",
|
||||
"changes",
|
||||
{ glob = "debian/**/control" },
|
||||
{ glob = "etc/apt/sources.list.d/*.sources"}
|
||||
]
|
||||
comment-tokens = "#"
|
||||
|
||||
[[grammar]]
|
||||
name = "debian"
|
||||
source = { git = "https://gitlab.com/MggMuggins/tree-sitter-debian", rev = "9b3f4b78c45aab8a2f25a5f9e7bbc00995bc3dde" }
|
||||
|
|
|
@ -64,6 +64,10 @@
|
|||
(array_pattern
|
||||
(identifier) @variable.parameter))
|
||||
|
||||
(public_field_definition) @punctuation.special
|
||||
(this_type) @variable.builtin
|
||||
(type_predicate) @keyword.operator
|
||||
|
||||
; Punctuation
|
||||
; -----------
|
||||
|
||||
|
@ -82,6 +86,7 @@
|
|||
[
|
||||
"abstract"
|
||||
"declare"
|
||||
"module"
|
||||
"export"
|
||||
"infer"
|
||||
"implements"
|
||||
|
@ -127,9 +132,16 @@
|
|||
">"
|
||||
] @punctuation.bracket)
|
||||
|
||||
(omitting_type_annotation) @punctuation.special
|
||||
(opting_type_annotation) @punctuation.special
|
||||
|
||||
; Literals
|
||||
; --------
|
||||
|
||||
[
|
||||
(template_literal_type)
|
||||
] @string
|
||||
|
||||
(import_require_clause
|
||||
(identifier) "="
|
||||
("require") @keyword)
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
"parallel"
|
||||
"reverse"
|
||||
"some"
|
||||
] @kewyord.control.repeat
|
||||
] @keyword.control.repeat
|
||||
[
|
||||
"return"
|
||||
] @keyword.control.return
|
||||
|
@ -114,7 +114,6 @@
|
|||
(loop_statement "end" @keyword.control.repeat)
|
||||
(if_statement "end" @keyword.control.conditional)
|
||||
(loop_parameter_specification "in" @keyword.control.repeat)
|
||||
(loop_parameter_specification "in" @keyword.control.repeat)
|
||||
(iterator_specification ["in" "of"] @keyword.control.repeat)
|
||||
(range_attribute_designator "range" @keyword.control.repeat)
|
||||
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
(comment) @comment
|
||||
(field_name) @tag
|
|
@ -74,16 +74,12 @@
|
|||
[
|
||||
"async"
|
||||
"debugger"
|
||||
"delete"
|
||||
"extends"
|
||||
"from"
|
||||
"get"
|
||||
"new"
|
||||
"set"
|
||||
"target"
|
||||
"typeof"
|
||||
"instanceof"
|
||||
"void"
|
||||
"with"
|
||||
] @keyword
|
||||
|
||||
|
@ -91,6 +87,10 @@
|
|||
"of"
|
||||
"as"
|
||||
"in"
|
||||
"delete"
|
||||
"typeof"
|
||||
"instanceof"
|
||||
"void"
|
||||
] @keyword.operator
|
||||
|
||||
[
|
||||
|
|
|
@ -0,0 +1,193 @@
|
|||
; Most primitive nodes
|
||||
(shebang) @keyword.directive
|
||||
|
||||
(comment) @comment
|
||||
|
||||
(fn_form
|
||||
name: [
|
||||
(symbol) @function
|
||||
(multi_symbol
|
||||
member: (symbol_fragment) @function .)
|
||||
])
|
||||
|
||||
(lambda_form
|
||||
name: [
|
||||
(symbol) @function
|
||||
(multi_symbol
|
||||
member: (symbol_fragment) @function .)
|
||||
])
|
||||
|
||||
((symbol) @operator
|
||||
(#any-of? @operator
|
||||
; arithmetic
|
||||
"+" "-" "*" "/" "//" "%" "^"
|
||||
; comparison
|
||||
">" "<" ">=" "<=" "=" "~="
|
||||
; other
|
||||
"#" "." "?." ".."))
|
||||
|
||||
((symbol) @keyword.operator
|
||||
(#any-of? @keyword.operator
|
||||
; comparison
|
||||
"not="
|
||||
; boolean
|
||||
"and" "or" "not"
|
||||
; bitwise
|
||||
"lshift" "rshift" "band" "bor" "bxor" "bnot"
|
||||
; other
|
||||
"length"))
|
||||
|
||||
(case_guard
|
||||
call: (_) @keyword.control.conditional)
|
||||
|
||||
(case_guard_or_special
|
||||
call: (_) @keyword.control.conditional)
|
||||
|
||||
(case_catch
|
||||
call: (symbol) @keyword)
|
||||
|
||||
(import_macros_form
|
||||
imports: (table_binding
|
||||
(table_binding_pair
|
||||
value: (symbol_binding) @function.macro)))
|
||||
|
||||
|
||||
((symbol) @keyword.function
|
||||
(#any-of? @keyword.function "fn" "lambda" "λ" "hashfn"))
|
||||
|
||||
((symbol) @keyword.control.repeat
|
||||
(#any-of? @keyword.control.repeat "for" "each" "while"))
|
||||
|
||||
((symbol) @keyword.control.conditional
|
||||
(#any-of? @keyword.control.conditional "if" "when" "match" "case" "match-try" "case-try"))
|
||||
|
||||
((symbol) @keyword
|
||||
(#any-of? @keyword
|
||||
"global" "local" "let" "set" "var" "comment" "do" "doc" "eval-compiler" "lua" "macros" "unquote"
|
||||
"quote" "tset" "values" "tail!"))
|
||||
|
||||
((symbol) @keyword.control.import
|
||||
(#any-of? @keyword.control.import "require" "require-macros" "import-macros" "include"))
|
||||
|
||||
((symbol) @function.macro
|
||||
(#any-of? @function.macro
|
||||
"collect" "icollect" "fcollect" "accumulate" "faccumulate" "->" "->>" "-?>" "-?>>" "?." "doto"
|
||||
"macro" "macrodebug" "partial" "pick-args" "pick-values" "with-open"))
|
||||
|
||||
((symbol) @variable.builtin
|
||||
(#eq? @variable.builtin "..."))
|
||||
|
||||
((symbol) @constant.builtin
|
||||
(#eq? @constant.builtin "_VERSION"))
|
||||
|
||||
((symbol) @function.builtin
|
||||
(#any-of? @function.builtin
|
||||
"assert" "collectgarbage" "dofile" "error" "getmetatable" "ipairs" "load" "loadfile" "next"
|
||||
"pairs" "pcall" "print" "rawequal" "rawget" "rawlen" "rawset" "require" "select" "setmetatable"
|
||||
"tonumber" "tostring" "type" "warn" "xpcall" "module" "setfenv" "loadstring" "unpack"))
|
||||
|
||||
; TODO: Highlight builtin methods (`table.unpack`, etc) as @function.builtin
|
||||
([
|
||||
(symbol) @variable.builtin
|
||||
(multi_symbol
|
||||
base: (symbol_fragment) @variable.builtin)
|
||||
]
|
||||
(#any-of? @variable.builtin
|
||||
"vim" "_G" "_ENV" "debug" "io" "jit" "math" "os" "package" "string" "table" "utf8"))
|
||||
|
||||
([
|
||||
(symbol) @variable.builtin
|
||||
(multi_symbol
|
||||
.
|
||||
(symbol_fragment) @variable.builtin)
|
||||
]
|
||||
(#eq? @variable.builtin "arg"))
|
||||
(symbol_option) @keyword.directive
|
||||
|
||||
(escape_sequence) @constant.character.escape
|
||||
|
||||
(multi_symbol
|
||||
"." @punctuation.delimiter
|
||||
member: (symbol_fragment) @variable.other.member)
|
||||
|
||||
(list
|
||||
call: (symbol) @function)
|
||||
|
||||
(list
|
||||
call: (multi_symbol
|
||||
member: (symbol_fragment) @function .))
|
||||
|
||||
(multi_symbol_method
|
||||
":" @punctuation.delimiter
|
||||
method: (symbol_fragment) @function.method)
|
||||
|
||||
(quasi_quote_reader_macro
|
||||
macro: _ @punctuation.special)
|
||||
|
||||
(quote_reader_macro
|
||||
macro: _ @punctuation.special)
|
||||
|
||||
(unquote_reader_macro
|
||||
macro: _ @punctuation.special)
|
||||
|
||||
(hashfn_reader_macro
|
||||
macro: _ @keyword.function)
|
||||
|
||||
(docstring) @comment.block.documentation
|
||||
|
||||
; NOTE: The macro name is highlighted as @variable because it
|
||||
; gives a nicer contrast instead of everything being the same
|
||||
; color. Rust queries use this workaround too for `macro_rules!`.
|
||||
(macro_form
|
||||
name: [
|
||||
(symbol) @variable
|
||||
(multi_symbol
|
||||
member: (symbol_fragment) @variable .)
|
||||
])
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"{"
|
||||
"}"
|
||||
"["
|
||||
"]"
|
||||
] @punctuation.bracket
|
||||
|
||||
(sequence_arguments
|
||||
(symbol_binding) @variable.parameter)
|
||||
|
||||
(sequence_arguments
|
||||
(rest_binding
|
||||
rhs: (symbol_binding) @variable.parameter))
|
||||
|
||||
((symbol) @variable.parameter
|
||||
(#any-of? @variable.parameter "$" "$..."))
|
||||
|
||||
((symbol) @variable.parameter
|
||||
(#any-of? @variable.parameter "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"))
|
||||
|
||||
[
|
||||
(nil)
|
||||
(nil_binding)
|
||||
] @constant.builtin
|
||||
|
||||
[
|
||||
(boolean)
|
||||
(boolean_binding)
|
||||
] @constant.builtin.boolean
|
||||
|
||||
[
|
||||
(number)
|
||||
(number_binding)
|
||||
] @constant.numeric
|
||||
|
||||
[
|
||||
(string)
|
||||
(string_binding)
|
||||
] @string
|
||||
|
||||
[
|
||||
(symbol)
|
||||
(symbol_binding)
|
||||
] @variable
|
|
@ -4,5 +4,7 @@
|
|||
(change type: "A" @diff.plus)
|
||||
(change type: "D" @diff.minus)
|
||||
(change type: "M" @diff.delta)
|
||||
(change type: "C" @diff.plus)
|
||||
(change type: "R" @diff.delta)
|
||||
|
||||
(comment) @comment
|
||||
|
|
|
@ -37,6 +37,13 @@
|
|||
|
||||
[(constructor_name) (tag)] @constructor
|
||||
|
||||
; Variables
|
||||
;----------
|
||||
|
||||
[(value_name) (type_variable)] @variable
|
||||
|
||||
(value_pattern) @variable.parameter
|
||||
|
||||
; Functions
|
||||
;----------
|
||||
|
||||
|
@ -75,13 +82,6 @@
|
|||
(application_expression
|
||||
function: (value_path (value_name) @function))
|
||||
|
||||
; Variables
|
||||
;----------
|
||||
|
||||
[(value_name) (type_variable)] @variable
|
||||
|
||||
(value_pattern) @variable.parameter
|
||||
|
||||
; Properties
|
||||
;-----------
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
[
|
||||
(directive_term)
|
||||
(clause_term)
|
||||
(arg_list)
|
||||
(list_notation)
|
||||
] @fold
|
|
@ -0,0 +1,43 @@
|
|||
(comment) @comment
|
||||
|
||||
(atom) @constant
|
||||
|
||||
((atom) @constant.builtin.boolean
|
||||
(#any-of? @constant.builtin.boolean "true" "false"))
|
||||
|
||||
(functional_notation
|
||||
function: (atom) @function)
|
||||
|
||||
(integer) @constant.numeric.integer
|
||||
|
||||
(float_number) @constant.numeric.float
|
||||
|
||||
(directive_head) @operator
|
||||
|
||||
(operator_notation
|
||||
operator: _ @operator)
|
||||
|
||||
[
|
||||
(open)
|
||||
(open_ct)
|
||||
(close)
|
||||
(open_list)
|
||||
"|"
|
||||
(close_list)
|
||||
(open_curly)
|
||||
(close_curly)
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
(arg_list_separator)
|
||||
(comma)
|
||||
(end)
|
||||
(list_notation_separator)
|
||||
] @punctuation.delimiter
|
||||
|
||||
(operator_notation
|
||||
operator: (semicolon) @punctuation.delimiter)
|
||||
|
||||
(double_quoted_list_notation) @string
|
||||
|
||||
(variable_term) @variable
|
|
@ -0,0 +1,12 @@
|
|||
(functional_notation
|
||||
(atom)
|
||||
(open_ct) @indent
|
||||
(close) @outdent)
|
||||
|
||||
(list_notation
|
||||
(open_list) @indent
|
||||
(close_list) @outdent)
|
||||
|
||||
(curly_bracketed_notation
|
||||
(open_curly) @indent
|
||||
(close_curly) @outdent)
|
|
@ -0,0 +1,2 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
|
@ -0,0 +1 @@
|
|||
; inherits: markdown
|
|
@ -0,0 +1 @@
|
|||
; inherits: markdown
|
|
@ -0,0 +1 @@
|
|||
; inherits: markdown
|
|
@ -0,0 +1,2 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
|
@ -0,0 +1,176 @@
|
|||
; reserved: must not be used in source code. https://www.w3.org/TR/WGSL/#reserved-words
|
||||
|
||||
; ((identifier) @special
|
||||
; (#any-of? @special
|
||||
; "NULL" "Self" "abstract" "active" "alignas" "alignof" "as" "asm"
|
||||
; "asm_fragment" "async" "attribute" "auto" "await" "become" "binding_array"
|
||||
; "cast" "catch" "class" "co_await" "co_return" "co_yield" "coherent"
|
||||
; "column_major" "common" "compile" "compile_fragment" "concept" "const_cast"
|
||||
; "consteval" "constexpr" "constinit" "crate" "debugger" "decltype" "delete"
|
||||
; "demote" "demote_to_helper" "do" "dynamic_cast" "enum" "explicit" "export"
|
||||
; "extends" "extern" "external" "fallthrough" "filter" "final" "finally" "friend"
|
||||
; "from" "fxgroup" "get" "goto" "groupshared" "highp" "impl" "implements" "import"
|
||||
; "inline" "instanceof" "interface" "layout" "lowp" "macro" "macro_rules" "match"
|
||||
; "mediump" "meta" "mod" "module" "move" "mut" "mutable" "namespace" "new"
|
||||
; "nil" "noexcept" "noinline" "nointerpolation" "non_coherent" "noncoherent"
|
||||
; "noperspective" "null" "nullptr" "of" "operator" "package" "packoffset"
|
||||
; "partition" "pass" "patch" "pixelfragment" "precise" "precision" "premerge"
|
||||
; "priv" "protected" "pub" "public" "readonly" "ref" "regardless" "register"
|
||||
; "reinterpret_cast" "require" "resource" "restrict" "self" "set" "shared"
|
||||
; "sizeof" "smooth" "snorm" "static" "static_assert" "static_cast" "std"
|
||||
; "subroutine" "super" "target" "template" "this" "thread_local" "throw" "trait"
|
||||
; "try" "type" "typedef" "typeid" "typename" "typeof" "union" "unless" "unorm"
|
||||
; "unsafe" "unsized" "use" "using" "varying" "virtual" "volatile" "wgsl" "where"
|
||||
; "with" "writeonly" "yield"))
|
||||
|
||||
; comments
|
||||
|
||||
(line_comment) @comment.line
|
||||
(block_comment) @comment.block
|
||||
|
||||
; imports (WESL extension)
|
||||
|
||||
(import_item (identifier) @type
|
||||
(#match? @type "^[A-Z]"))
|
||||
|
||||
(import_item (identifier) @constant
|
||||
(#match? @constant "^[A-Z0-9_]+$"))
|
||||
|
||||
(import_item (identifier) @namespace)
|
||||
|
||||
(import_path (identifier) @namespace)
|
||||
|
||||
(ident_path (identifier) @namespace)
|
||||
|
||||
; types
|
||||
|
||||
((identifier) @constant
|
||||
(#match? @constant "^[A-Z0-9_]+$"))
|
||||
|
||||
((identifier) @type
|
||||
(#match? @type "^[A-Z]"))
|
||||
|
||||
(type_specifier
|
||||
(identifier) @type)
|
||||
|
||||
; functions
|
||||
|
||||
(function_decl
|
||||
(function_header
|
||||
(identifier) @function))
|
||||
|
||||
(call_expression
|
||||
(identifier) @function)
|
||||
|
||||
; templates
|
||||
|
||||
(template_list) @punctuation
|
||||
|
||||
(variable_decl ; this is var<storage> et.al
|
||||
(template_list
|
||||
(identifier) @keyword.storage.modifier))
|
||||
|
||||
(type_specifier
|
||||
(template_list
|
||||
(identifier) @type))
|
||||
|
||||
(template_list
|
||||
(template_list
|
||||
(identifier) @type))
|
||||
|
||||
; attributes
|
||||
|
||||
(attribute
|
||||
(identifier) @attribute) @attribute
|
||||
|
||||
(attribute
|
||||
(identifier) @attr-name
|
||||
(argument_list
|
||||
(identifier) @variable.builtin)
|
||||
(#eq? @attr-name "builtin"))
|
||||
|
||||
; variables, names
|
||||
|
||||
(param
|
||||
(identifier) @variable.parameter)
|
||||
(variable_decl
|
||||
(identifier) @variable)
|
||||
(const_assert_statement) @variable
|
||||
|
||||
(struct_decl
|
||||
(identifier) @type)
|
||||
|
||||
(struct_member
|
||||
name: (_) @variable.other.member)
|
||||
|
||||
(named_component_expression
|
||||
component: (_) @variable.other.member)
|
||||
|
||||
(identifier) @variable
|
||||
|
||||
; literals
|
||||
|
||||
(bool_literal) @constant.builtin.boolean
|
||||
(int_literal) @constant.numeric.integer
|
||||
(float_literal) @constant.numeric.float
|
||||
|
||||
|
||||
; keywords
|
||||
|
||||
[
|
||||
"if"
|
||||
"else"
|
||||
] @keyword.control.conditional
|
||||
[
|
||||
"loop"
|
||||
"for"
|
||||
"while"
|
||||
"break"
|
||||
"continue"
|
||||
] @keyword.control.repeat
|
||||
[
|
||||
"return"
|
||||
] @keyword.control.return
|
||||
[
|
||||
"switch"
|
||||
"case"
|
||||
"default"
|
||||
"discard"
|
||||
] @keyword.control
|
||||
[ ; WESL import extension
|
||||
"import"
|
||||
"as"
|
||||
] @keyword.control.import
|
||||
[
|
||||
"fn"
|
||||
] @keyword.function
|
||||
[
|
||||
"var"
|
||||
"let"
|
||||
"const"
|
||||
"struct"
|
||||
] @keyword.storage.type
|
||||
[
|
||||
"alias"
|
||||
"virtual" ; Bevy / naga_oil extension
|
||||
"override" ; Bevy / naga_oil extension
|
||||
] @keyword
|
||||
|
||||
; expressions
|
||||
|
||||
[
|
||||
"-" "!" "~" "*" "&" ; unary
|
||||
"^" "|" "/" "%" "+" (shift_left) (shift_right) ; binary
|
||||
(less_than) (greater_than) (less_than_equal) (greater_than_equal) "==" "!=" ; relational
|
||||
"+=" "-=" "*=" "/=" "%=" "|=" "^=" "++" "--" "=" ; assign
|
||||
"->" ; return
|
||||
] @operator
|
||||
|
||||
; punctuation
|
||||
|
||||
[ "(" ")" "[" "]" "{" "}" ] @punctuation.bracket
|
||||
[ "," "." ":" ";" ] @punctuation.delimiter
|
||||
|
||||
; preprocessor
|
||||
|
||||
[ (preproc_directive) "#import" ] @keyword.directive
|
|
@ -0,0 +1,2 @@
|
|||
([(line_comment) (block_comment)] @injection.content
|
||||
(#set! injection.language "comment"))
|
|
@ -0,0 +1,18 @@
|
|||
; Scopes
|
||||
|
||||
[
|
||||
(global_decl)
|
||||
(switch_body)
|
||||
(compound_statement)
|
||||
] @local.scope
|
||||
|
||||
; Definitions
|
||||
|
||||
(param
|
||||
(identifier) @local.definition)
|
||||
|
||||
; References
|
||||
|
||||
(identifier) @local.reference
|
||||
; (type_specifier) @local.reference
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
(function_decl
|
||||
body: (_) @function.inside) @function.around
|
||||
|
||||
(struct_decl
|
||||
body: (_) @class.inside) @class.around
|
||||
|
||||
(param_list
|
||||
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
||||
|
||||
(argument_list
|
||||
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
||||
|
||||
(template_list
|
||||
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
||||
|
||||
[
|
||||
(line_comment)
|
||||
(block_comment)
|
||||
] @comment.inside
|
||||
|
||||
(line_comment)+ @comment.around
|
||||
|
||||
(block_comment) @comment.around
|
|
@ -43,21 +43,22 @@
|
|||
|
||||
"special" = "blue" # fuzzy highlight
|
||||
|
||||
"markup.heading.marker" = { fg = "peach", modifiers = ["bold"] }
|
||||
"markup.heading.1" = "lavender"
|
||||
"markup.heading.2" = "mauve"
|
||||
"markup.heading.3" = "green"
|
||||
"markup.heading.4" = "yellow"
|
||||
"markup.heading.5" = "pink"
|
||||
"markup.heading.6" = "teal"
|
||||
"markup.list" = "mauve"
|
||||
"markup.heading.1" = "red"
|
||||
"markup.heading.2" = "peach"
|
||||
"markup.heading.3" = "yellow"
|
||||
"markup.heading.4" = "green"
|
||||
"markup.heading.5" = "sapphire"
|
||||
"markup.heading.6" = "lavender"
|
||||
"markup.list" = "teal"
|
||||
"markup.list.unchecked" = "overlay2"
|
||||
"markup.list.checked" = "green"
|
||||
"markup.bold" = { modifiers = ["bold"] }
|
||||
"markup.italic" = { modifiers = ["italic"] }
|
||||
"markup.bold" = { fg = "red", modifiers = ["bold"] }
|
||||
"markup.italic" = { fg = "red", modifiers = ["italic"] }
|
||||
"markup.link.url" = { fg = "blue", modifiers = ["italic", "underlined"] }
|
||||
"markup.link.text" = "blue"
|
||||
"markup.raw" = "flamingo"
|
||||
"markup.link.text" = "lavender"
|
||||
"markup.link.label" = "sapphire"
|
||||
"markup.raw" = "green"
|
||||
"markup.quote" = "pink"
|
||||
|
||||
"diff.plus" = "green"
|
||||
"diff.minus" = "red"
|
||||
|
@ -72,9 +73,9 @@
|
|||
|
||||
"ui.statusline" = { fg = "subtext1", bg = "mantle" }
|
||||
"ui.statusline.inactive" = { fg = "surface2", bg = "mantle" }
|
||||
"ui.statusline.normal" = { fg = "base", bg = "lavender", modifiers = ["bold"] }
|
||||
"ui.statusline.insert" = { fg = "base", bg = "green", modifiers = ["bold"] }
|
||||
"ui.statusline.select" = { fg = "base", bg = "flamingo", modifiers = ["bold"] }
|
||||
"ui.statusline.normal" = { fg = "base", bg = "rosewater", modifiers = ["bold"] }
|
||||
"ui.statusline.insert" = { fg = "base", bg = "green", modifiers = ["bold"] }
|
||||
"ui.statusline.select" = { fg = "base", bg = "lavender", modifiers = ["bold"] }
|
||||
|
||||
"ui.popup" = { fg = "text", bg = "surface0" }
|
||||
"ui.window" = { fg = "crust" }
|
||||
|
@ -101,13 +102,13 @@
|
|||
"ui.cursor.primary" = { fg = "base", bg = "rosewater" }
|
||||
"ui.cursor.match" = { fg = "peach", modifiers = ["bold"] }
|
||||
|
||||
"ui.cursor.primary.normal" = { fg = "base", bg = "lavender" }
|
||||
"ui.cursor.primary.normal" = { fg = "base", bg = "rosewater" }
|
||||
"ui.cursor.primary.insert" = { fg = "base", bg = "green" }
|
||||
"ui.cursor.primary.select" = { fg = "base", bg = "flamingo" }
|
||||
"ui.cursor.primary.select" = { fg = "base", bg = "lavender" }
|
||||
|
||||
"ui.cursor.normal" = { fg = "base", bg = "secondary_cursor_normal" }
|
||||
"ui.cursor.insert" = { fg = "base", bg = "secondary_cursor_insert" }
|
||||
"ui.cursor.select" = { fg = "base", bg = "secondary_cursor" }
|
||||
"ui.cursor.select" = { fg = "base", bg = "secondary_cursor_select" }
|
||||
|
||||
"ui.cursorline.primary" = { bg = "cursorline" }
|
||||
|
||||
|
@ -116,11 +117,11 @@
|
|||
"ui.menu" = { fg = "overlay2", bg = "surface0" }
|
||||
"ui.menu.selected" = { fg = "text", bg = "surface1", modifiers = ["bold"] }
|
||||
|
||||
"diagnostic.unnecessary" = { modifiers = ["dim"] }
|
||||
"diagnostic.error" = { underline = { color = "red", style = "curl" } }
|
||||
"diagnostic.warning" = { underline = { color = "yellow", style = "curl" } }
|
||||
"diagnostic.info" = { underline = { color = "sky", style = "curl" } }
|
||||
"diagnostic.hint" = { underline = { color = "teal", style = "curl" } }
|
||||
"diagnostic.unnecessary" = { modifiers = ["dim"] }
|
||||
|
||||
error = "red"
|
||||
warning = "yellow"
|
||||
|
@ -157,5 +158,6 @@ crust = "#11111b"
|
|||
|
||||
cursorline = "#2a2b3c"
|
||||
secondary_cursor = "#b5a6a8"
|
||||
secondary_cursor_normal = "#878ec0"
|
||||
secondary_cursor_select = "#878ec0"
|
||||
secondary_cursor_normal = "#b5a6a8"
|
||||
secondary_cursor_insert = "#7ea87f"
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
# Author : Steven Vancoillie <steven.vancoillie@gmail.com>
|
||||
#
|
||||
# Migraine-friendly, minimal color scheme focused only on structural elements
|
||||
# like types, functions, and keywords.
|
||||
|
||||
"comment" = { modifiers = ["dim"] }
|
||||
"diagnostic.error" = { underline = { color = "blush", style = "curl" } }
|
||||
"diagnostic.hint" = { underline = { color = "sky", style = "curl" } }
|
||||
"diagnostic.info" = { underline = { color = "grey", style = "curl" } }
|
||||
"diagnostic.warning" = { underline = { color = "maple", style = "curl" } }
|
||||
"diff.delta" = "silver"
|
||||
"diff.minus" = "blush"
|
||||
"diff.plus" = "jade"
|
||||
"error" = "blush"
|
||||
"function" = { modifiers = ["bold"] }
|
||||
"hint" = "sky"
|
||||
"info" = "grey"
|
||||
"keyword" = "earl"
|
||||
"type" = "maple"
|
||||
"ui.background" = { bg = "chaotica" }
|
||||
"ui.background.separator" = { fg = "snow" }
|
||||
"ui.cursor" = { fg = "black", bg = "earl" }
|
||||
"ui.cursorline.primary" = { bg = "deepspace" }
|
||||
"ui.help" = { bg = "deepspace", fg = "snow" }
|
||||
"ui.highlight" = { bg = "space" }
|
||||
"ui.linenr" = { fg = "grey" }
|
||||
"ui.linenr.selected" = { fg = "earl" }
|
||||
"ui.menu" = { fg = "snow", bg = "deepspace" }
|
||||
"ui.menu.scroll" = { fg = "grey", bg = "deepspace" }
|
||||
"ui.menu.selected" = { fg = "snow", bg = "lacquer" }
|
||||
"ui.popup" = { bg = "deepspace" }
|
||||
"ui.selection" = { bg = "lacquer" }
|
||||
"ui.statusline" = { fg = "earl", bg = "deepspace" }
|
||||
"ui.statusline.inactive" = { fg = "snow", bg = "deepspace", modifiers = ["dim"] }
|
||||
"ui.statusline.insert" = { fg = "chaotica", bg = "earl", modifiers = ["bold"] }
|
||||
"ui.statusline.normal" = { fg = "chaotica", bg = "sky", modifiers = ["bold"] }
|
||||
"ui.statusline.select" = { fg = "chaotica", bg = "myrtle", modifiers = ["bold"] }
|
||||
"ui.text" = { fg = "silver" }
|
||||
"ui.text.focus" = { fg = "snow" }
|
||||
"ui.virtual" = { fg = "space" }
|
||||
"ui.virtual.indent-guide" = { fg = "space" }
|
||||
"ui.virtual.inlay-hint" = { fg = "lacquer" }
|
||||
"ui.virtual.jump-label" = { fg = "myrtle" }
|
||||
"ui.virtual.ruler" = { bg = "space" }
|
||||
"ui.window" = { fg = "space" }
|
||||
"warning" = "maple"
|
||||
|
||||
[palette]
|
||||
black = "#000000"
|
||||
chaotica = "#101010"
|
||||
deepspace = "#1b1b1b"
|
||||
space = "#2a2a2d"
|
||||
lacquer = "#3e3e3e"
|
||||
darkgrey = "#505050"
|
||||
grey = "#808080"
|
||||
silver = "#a6a6a6"
|
||||
snow = "#f0f0f0"
|
||||
white = "#ffffff"
|
||||
blush = "#e78284"
|
||||
jade = "#90b99f"
|
||||
earl = "#b59efc"
|
||||
sky = "#99bbe0"
|
||||
myrtle = "#e29eca"
|
||||
maple = "#e5c890"
|
|
@ -0,0 +1,128 @@
|
|||
# Gruvbox Material for Helix
|
||||
# Original Author: @sainnhe (https://github.com/sainnhe/gruvbox-material)
|
||||
# Ported by: @satoqz
|
||||
# License: MIT
|
||||
|
||||
"attribute" = "green"
|
||||
"comment" = { fg = "grey1", modifiers = ["italic"] }
|
||||
"constant" = "fg0"
|
||||
"constant.builtin" = "purple"
|
||||
"constant.character.escape" = "green"
|
||||
"constant.numeric" = "purple"
|
||||
"constructor" = "green"
|
||||
"function" = "green"
|
||||
"keyword" = "red"
|
||||
"keyword.directive" = "purple"
|
||||
"keyword.operator" = "orange"
|
||||
"label" = "red"
|
||||
"namespace" = "yellow"
|
||||
"operator" = "orange"
|
||||
"punctuation" = "grey1"
|
||||
"punctuation.bracket" = "fg0"
|
||||
"punctuation.delimiter" = "grey1"
|
||||
"punctuation.special" = "blue"
|
||||
"special" = "green"
|
||||
"string" = "aqua"
|
||||
"string.regexp" = "green"
|
||||
"string.special.path" = "yellow"
|
||||
"string.special.symbol" = "fg0"
|
||||
"string.special.url" = { fg = "fg0", modifiers = ["underlined"] }
|
||||
"tag" = "orange"
|
||||
"type" = "yellow"
|
||||
"type.enum.variant" = "purple"
|
||||
"variable" = "fg0"
|
||||
"variable.builtin" = "purple"
|
||||
"variable.other.member" = "blue"
|
||||
"variable.parameter" = "fg0"
|
||||
|
||||
"markup.heading.1" = "red"
|
||||
"markup.heading.2" = "orange"
|
||||
"markup.heading.3" = "yellow"
|
||||
"markup.heading.4" = "green"
|
||||
"markup.heading.5" = "blue"
|
||||
"markup.heading.6" = "purple"
|
||||
|
||||
"markup.bold" = { fg = "fg0", modifiers = ["bold"] }
|
||||
"markup.italic" = { fg = "fg0", modifiers = ["italic"] }
|
||||
"markup.strikethrough" = { fg = "fg0", modifiers = ["crossed_out"] }
|
||||
|
||||
"markup.link.label" = "blue"
|
||||
"markup.link.text" = "yellow"
|
||||
"markup.link.url" = { fg = "blue", modifiers = ["underlined"] }
|
||||
"markup.list" = "blue"
|
||||
"markup.list.checked" = "green"
|
||||
"markup.list.unchecked" = "grey1"
|
||||
"markup.quote" = "grey1"
|
||||
"markup.raw" = "green"
|
||||
|
||||
"diff.delta" = "blue"
|
||||
"diff.minus" = "red"
|
||||
"diff.plus" = "green"
|
||||
|
||||
"diagnostic.error" = { underline = { color = "red", style = "curl" } }
|
||||
"diagnostic.hint" = { underline = { color = "green", style = "curl" } }
|
||||
"diagnostic.info" = { underline = { color = "blue", style = "curl" } }
|
||||
"diagnostic.unnecessary" = { modifiers = ["dim"] }
|
||||
"diagnostic.warning" = { underline = { color = "yellow", style = "curl" } }
|
||||
|
||||
error = "red"
|
||||
hint = "green"
|
||||
info = "blue"
|
||||
warning = "yellow"
|
||||
|
||||
"ui.background" = { fg = "fg0", bg = "bg0" }
|
||||
"ui.bufferline" = { fg = "fg1", bg = "bg4" }
|
||||
"ui.bufferline.active" = { fg = "bg0", bg = "grey2" }
|
||||
"ui.bufferline.background" = { bg = "bg1" }
|
||||
"ui.cursor" = { fg = "bg0", bg = "grey1" }
|
||||
"ui.cursor.primary" = { fg = "bg0", bg = "fg0" }
|
||||
"ui.cursor.match" = { bg = "bg2" }
|
||||
"ui.cursorline.primary" = { bg = "bg1" }
|
||||
"ui.help" = { fg = "grey1", bg = "bg0" }
|
||||
"ui.highlight" = { bg = "bg2" }
|
||||
"ui.linenr" = "bg3"
|
||||
"ui.linenr.selected" = "grey1"
|
||||
"ui.menu" = { fg = "fg1", bg = "bg2" }
|
||||
"ui.menu.scroll" = { fg = "grey0", bg = "bg1" }
|
||||
"ui.menu.selected" = { fg = "bg2", bg = "grey2" }
|
||||
"ui.popup" = { fg = "fg1", bg = "bg2" }
|
||||
"ui.popup.info" = { "fg" = "grey1", bg = "bg0" }
|
||||
"ui.selection" = { bg = "bg2" }
|
||||
"ui.statusline" = { fg = "fg1", bg = "bg1" }
|
||||
"ui.statusline.inactive" = { fg = "grey1", bg = "bg1" }
|
||||
"ui.statusline.insert" = { fg = "bg0", bg = "green" }
|
||||
"ui.statusline.normal" = { fg = "bg0", bg = "grey2" }
|
||||
"ui.statusline.select" = { fg = "bg0", bg = "red" }
|
||||
"ui.text" = "fg0"
|
||||
"ui.text.directory" = { fg = "blue" }
|
||||
"ui.text.focus" = { bg = "bg2" }
|
||||
"ui.text.inactive" = { fg = "grey1" }
|
||||
"ui.text.info" = "grey1"
|
||||
"ui.virtual" = "grey0"
|
||||
"ui.virtual.indent-guide" = "bg3"
|
||||
"ui.virtual.inlay-hint" = "grey0"
|
||||
"ui.virtual.jump-label" = "grey2"
|
||||
"ui.virtual.ruler" = { bg = "bg1" }
|
||||
"ui.window" = { fg = "bg3" }
|
||||
|
||||
[palette]
|
||||
fg0 = "#d4be98"
|
||||
fg1 = "#ddc7a1"
|
||||
|
||||
bg0 = "#282828"
|
||||
bg1 = "#32302f"
|
||||
bg2 = "#45403d"
|
||||
bg3 = "#5a524c"
|
||||
bg4 = "#504945"
|
||||
|
||||
grey0 = "#7c6f64"
|
||||
grey1 = "#928374"
|
||||
grey2 = "#a89984"
|
||||
|
||||
aqua = "#89b482"
|
||||
blue = "#7daea3"
|
||||
green = "#a9b665"
|
||||
orange = "#e78a4e"
|
||||
purple = "#d3869b"
|
||||
red = "#ea6962"
|
||||
yellow = "#d8a657"
|
|
@ -106,6 +106,7 @@
|
|||
"ui.statusline.select" = { fg = "bg1", bg = "orange1", modifiers = ["bold"] }
|
||||
|
||||
"ui.text" = { fg = "fg1" }
|
||||
"ui.text.focus" = { fg = "green1" }
|
||||
"ui.text.directory" = { fg = "blue1" }
|
||||
"ui.virtual.inlay-hint" = { fg = "gray" }
|
||||
"ui.virtual.jump-label" = { fg = "purple0", modifiers = ["bold"] }
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
# Author : geonove <andre.novellini@gmail.com>
|
||||
# License : Vim License
|
||||
|
||||
"ui.menu" = { fg = "light-gray", bg = "gray" }
|
||||
"ui.menu.selected" = { modifiers = ["reversed"] }
|
||||
"ui.linenr" = "yellow"
|
||||
"ui.popup" = { bg = "black" }
|
||||
"ui.window" = { bg = "black" }
|
||||
"ui.linenr.selected" = "light-yellow"
|
||||
"ui.selection" = { fg = "gray", modifiers = ["reversed"] }
|
||||
"ui.text.focus" = { fg = "black", bg = "white" }
|
||||
"comment" = "light-green"
|
||||
"comment.line" = "light-green"
|
||||
"comment.block" = "red"
|
||||
"comment.block.documentation" = "red"
|
||||
"ui.statusline" = { fg = "black", bg = "light-cyan" }
|
||||
"ui.statusline.inactive" = { fg = "gray", bg = "black" }
|
||||
"ui.help" = { fg = "white", bg = "black" }
|
||||
"ui.cursor" = { fg = "light-gray", modifiers = ["reversed"] }
|
||||
"ui.cursor.primary" = { fg = "light-gray", modifiers = ["reversed"] }
|
||||
"ui.virtual.whitespace" = "light-gray"
|
||||
"ui.virtual.jump-label" = { fg = "blue", modifiers = ["bold", "underlined"] }
|
||||
"ui.virtual.ruler" = { bg = "black" }
|
||||
"variable" = "white"
|
||||
"constant.numeric" = "red"
|
||||
"constant" = "white"
|
||||
"constant.builtin" = "red"
|
||||
"attribute" = "yellow"
|
||||
"type" = "green"
|
||||
"type.builtin" = "cyan"
|
||||
"ui.cursor.match" = { fg = "light-gray", modifiers = ["reversed"] }
|
||||
"string" = "red"
|
||||
"variable.other.member" = "white"
|
||||
"constant.character.escape" = "light-cyan"
|
||||
#"function.builtin" = "cyan"
|
||||
#"function.method" = "cyan"
|
||||
#"function.method.private" = "cyan"
|
||||
"function" = "cyan"
|
||||
"constructor" = "cyan"
|
||||
"special" = "light-blue"
|
||||
"keyword" = "yellow"
|
||||
"keyword.control.import" = "magenta"
|
||||
"label" = "white"
|
||||
"namespace" = "white"
|
||||
|
||||
"markup.heading" = "light-magenta"
|
||||
"markup.list" = "light-red"
|
||||
"markup.bold" = { fg = "light-yellow", modifiers = ["bold"] }
|
||||
"markup.italic" = { fg = "light-magenta", modifiers = ["italic"] }
|
||||
"markup.strikethrough" = { modifiers = ["crossed_out"] }
|
||||
"markup.link.url" = { fg = "yellow", modifiers = ["underlined"] }
|
||||
"markup.link.text" = "light-red"
|
||||
"markup.quote" = "light-cyan"
|
||||
"markup.raw" = "light-green"
|
||||
|
||||
"diff.plus" = "light-green"
|
||||
"diff.delta" = "yellow"
|
||||
"diff.minus" = "light-red"
|
||||
|
||||
"diagnostic" = { modifiers = ["underlined"] }
|
||||
"info" = "light-blue"
|
||||
"hint" = "gray"
|
||||
"debug" = "gray"
|
||||
"warning" = "yellow"
|
||||
"error" = "light-red"
|
|
@ -11,7 +11,7 @@
|
|||
"constant" = "purple"
|
||||
"number" = "purple"
|
||||
"string" = "fg"
|
||||
"comment" = "grey2"
|
||||
"comment" = { fg = "grey2", modifiers = [ "italic" ] }
|
||||
"variable" = "yellow"
|
||||
"variable.builtin" = "blue"
|
||||
"variable.parameter" = "yellow"
|
||||
|
@ -33,33 +33,49 @@
|
|||
"special" = "orange"
|
||||
|
||||
"ui.background" = { bg = "bg0" }
|
||||
"ui.cursor" = { fg = "bg0", bg = "fg" }
|
||||
"ui.cursor.match" = { fg = "grey0", bg = "grey2" }
|
||||
"ui.cursor.insert" = { fg = "bg0", bg = "bg_yellow" }
|
||||
"ui.cursor.select" = { fg = "bg0", bg = "bg_yellow" }
|
||||
"ui.linenr" = "yellow"
|
||||
"ui.linenr.selected" = { fg = "fg", modifiers = ["bold", "underlined"] }
|
||||
"ui.background.separator" = { fg = "bg2" }
|
||||
"ui.bufferline" = { fg = "grey1" }
|
||||
"ui.bufferline.active" = { fg = "yellow" }
|
||||
"ui.bufferline.background" = { bg = "bg2" }
|
||||
"ui.cursor" = { fg = "fg", bg = "dark-red" }
|
||||
"ui.cursor.match" = { fg = "grey2", bg = "pale-yellow" }
|
||||
"ui.cursor.insert" = { fg = "bg0", bg = "pale-yellow" }
|
||||
"ui.cursor.select" = { fg = "bg0", bg = "bg-yellow" }
|
||||
"ui.cursor.primary" = { fg = "dark-red", bg = "fg" }
|
||||
"ui.cursor.primary.match" = { fg = "pale-yellow", bg = "grey2" }
|
||||
"ui.cursor.primary.insert" = { fg = "dark-red", bg = "bg-yellow" }
|
||||
"ui.cursor.primary.select" = { fg = "yellow", bg = "nasty-red" }
|
||||
"ui.linenr" = { fg = "yellow", modifiers = ["dim"] }
|
||||
"ui.linenr.selected" = { fg = "fg", modifiers = ["dim"], underline.style = "line" }
|
||||
"ui.cursorline" = { fg = "grey1", bg = "bg2" }
|
||||
"ui.statusline" = { fg = "grey1", bg = "bg2" }
|
||||
"ui.statusline.inactive" = { fg = "grey2", bg = "bg1" }
|
||||
"ui.statusline.inactive" = { fg = "bg5", bg = "bg1" }
|
||||
"ui.statusline.insert" = { fg = "blue" }
|
||||
"ui.statusline.select" = { fg = "pale-yellow" }
|
||||
"ui.popup" = { fg = "grey2", bg = "bg1" }
|
||||
"ui.window" = { fg = "grey2", bg = "bg1" }
|
||||
"ui.picker.header" = { fg = "bg2", underline.style = "dashed" }
|
||||
"ui.window" = { fg = "bg1", bg = "bg1" }
|
||||
"ui.help" = { fg = "fg", bg = "bg1" }
|
||||
"ui.text" = "fg"
|
||||
"ui.text.focus" = "yellow"
|
||||
"ui.text.inactive" = { fg = "fg", modifiers = [ "dim" ] }
|
||||
"ui.text.directory" = "grey0"
|
||||
"ui.menu" = { fg = "fg", bg = "bg2" }
|
||||
"ui.menu.selected" = { fg = "bg0", bg = "bg_yellow" }
|
||||
"ui.selection" = { bg = "bg3" }
|
||||
"ui.virtual.whitespace" = "bg2"
|
||||
"ui.virtual.ruler" = { bg = "grey2" }
|
||||
"ui.menu.selected" = { fg = "bg0", bg = "bg-yellow" }
|
||||
"ui.selection" = { bg = "yellow", modifiers = [ "dim" ] }
|
||||
"ui.selection.prime" = { underline.style = "line" }
|
||||
"ui.virtual.inlay-hint" = { fg = "grey2", modifiers = ["italic"] }
|
||||
"ui.virtual.jump-label" = { fg = "nasty-red", modifiers = ["bold"] }
|
||||
"ui.virtual.ruler" = { bg = "bg1" }
|
||||
"ui.virtual.whitespace" = { fg = "grey2", modifiers = [ "italic" ] }
|
||||
"ui.virtual.wrap" = { fg = "grey2", modifiers = [ "italic" ] }
|
||||
|
||||
"hint" = "blue"
|
||||
"info" = "aqua"
|
||||
"warning" = "yellow"
|
||||
"error" = "nasty-red"
|
||||
|
||||
"diagnostic" = { underline = { style = "curl", color = "purple" } }
|
||||
"diagnostic.hint" = { underline = { style = "curl", color = "blue" } }
|
||||
"diagnostic.info" = { underline = { style = "curl", color = "aqua" } }
|
||||
"diagnostic.warning" = { underline = { style = "curl", color = "yellow" } }
|
||||
|
@ -89,22 +105,23 @@ bg2 = "#55585e"
|
|||
bg3 = "#61656b"
|
||||
bg4 = "#6d7278"
|
||||
bg5 = "#797e86"
|
||||
bg_visual = "#646669"
|
||||
bg_red = "#7e2a33"
|
||||
bg_green = "#86b365"
|
||||
bg_blue = "#6a89af"
|
||||
bg_yellow = "#e2b714"
|
||||
bg-visual = "#646669"
|
||||
bg-red = "#7e2a33"
|
||||
bg-green = "#86b365"
|
||||
bg-blue = "#6a89af"
|
||||
bg-yellow = "#e2b714"
|
||||
|
||||
fg = "#d1d0c5"
|
||||
red = "#f9ebed"
|
||||
red = "#e29da7"
|
||||
nasty-red = "#ca4754"
|
||||
dark-red = "#7e2a33"
|
||||
orange = "#dd8a3c"
|
||||
yellow = "#e2b714"
|
||||
green = "#e5eae1"
|
||||
pale-yellow = "#f3e0a1"
|
||||
green = "#bcd5a8"
|
||||
aqua = "#b9c2c6"
|
||||
blue = "#bdcadb"
|
||||
purple = "#d0c4d4"
|
||||
blue = "#adc9db"
|
||||
purple = "#be9ec9"
|
||||
grey0 = "#aaaeb3"
|
||||
grey1 = "#e1e1e3"
|
||||
grey2 = "#646669"
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"constant" = "purple"
|
||||
"number" = "purple"
|
||||
"string" = "fg"
|
||||
"comment" = "grey2"
|
||||
"comment" = { fg = "grey2", modifiers = [ "italic" ] }
|
||||
"variable" = "yellow"
|
||||
"variable.builtin" = "blue"
|
||||
"variable.parameter" = "yellow"
|
||||
|
@ -21,7 +21,7 @@
|
|||
"punctuation.delimiter" = "grey2"
|
||||
"punctuation.bracket" = "fg"
|
||||
"keyword" = "red"
|
||||
"operator" = "grey0"
|
||||
"operator" = "grey2"
|
||||
"function" = "green"
|
||||
"function.builtin" = "blue"
|
||||
"function.macro" = "aqua"
|
||||
|
@ -33,32 +33,49 @@
|
|||
"special" = "orange"
|
||||
|
||||
"ui.background" = { bg = "bg0" }
|
||||
"ui.cursor" = { fg = "bg0", bg = "fg" }
|
||||
"ui.cursor.match" = { fg = "grey1", bg = "grey2" }
|
||||
"ui.cursor.insert" = { fg = "bg0", bg = "bg_yellow" }
|
||||
"ui.cursor.select" = { fg = "bg0", bg = "bg_yellow" }
|
||||
"ui.linenr" = "yellow"
|
||||
"ui.linenr.selected" = { fg = "fg", modifiers = ["bold", "underlined"] }
|
||||
"ui.cursorline" = { bg = "bg01" }
|
||||
"ui.background.separator" = { fg = "bg5" }
|
||||
"ui.bufferline" = { fg = "grey1" }
|
||||
"ui.bufferline.active" = { fg = "pale-yellow" }
|
||||
"ui.bufferline.background" = { bg = "bg5" }
|
||||
"ui.cursor" = { fg = "bg0", bg = "dark-red" }
|
||||
"ui.cursor.match" = { fg = "pale-yellow", bg = "bg5" }
|
||||
"ui.cursor.insert" = { fg = "fg", bg = "pale-yellow" }
|
||||
"ui.cursor.select" = { fg = "fg", bg = "bg-yellow" }
|
||||
"ui.cursor.primary" = { fg = "nasty-red", bg = "grey0" }
|
||||
"ui.cursor.primary.match" = { fg = "grey2", bg = "pale-yellow" }
|
||||
"ui.cursor.primary.insert" = { fg = "dark-red", bg = "yellow" }
|
||||
"ui.cursor.primary.select" = { fg = "yellow", bg = "dark-red" }
|
||||
"ui.linenr" = { fg = "yellow", modifiers = ["dim"] }
|
||||
"ui.linenr.selected" = { fg = "fg", modifiers = ["dim"], underline.style = "line" }
|
||||
"ui.cursorline" = { bg = "bg0", modifiers = ["dim"] }
|
||||
"ui.statusline" = { fg = "grey1", bg = "bg5" }
|
||||
"ui.statusline.inactive" = { fg = "grey2", bg = "bg1" }
|
||||
"ui.statusline.inactive" = { fg = "grey1", bg = "bg3" }
|
||||
"ui.statusline.insert" = { fg = "blue" }
|
||||
"ui.statusline.select" = { fg = "pale-yellow" }
|
||||
"ui.popup" = { fg = "bg0", bg = "bg5" }
|
||||
"ui.window" = { fg = "bg0", bg = "bg5" }
|
||||
"ui.picker.header" = { fg = "bg2", underline.style = "dashed" }
|
||||
"ui.window" = { fg = "bg5", bg = "bg5" }
|
||||
"ui.help" = { fg = "bg0", bg = "bg5" }
|
||||
"ui.text" = "fg"
|
||||
"ui.text.focus" = "yellow"
|
||||
"ui.text.inactive" = { fg = "fg", modifiers = [ "dim" ] }
|
||||
"ui.text.directory" = "grey2"
|
||||
"ui.menu" = { fg = "bg0", bg = "bg3" }
|
||||
"ui.menu.selected" = { fg = "bg0", bg = "bg_yellow" }
|
||||
"ui.selection" = { fg = "bg0", bg = "bg3" }
|
||||
"ui.virtual.whitespace" = { fg = "bg2" }
|
||||
"ui.virtual.ruler" = { bg = "bg01" }
|
||||
"ui.menu.selected" = { fg = "bg0", bg = "bg-yellow" }
|
||||
"ui.selection" = { bg = "grey0", modifiers = [ "dim" ] }
|
||||
"ui.selection.prime" = { underline.style = "line" }
|
||||
"ui.virtual.inlay-hint" = { fg = "grey2", modifiers = ["italic"] }
|
||||
"ui.virtual.jump-label" = { fg = "nasty-red", modifiers = ["bold"] }
|
||||
"ui.virtual.ruler" = { bg = "bg0", modifiers = ["dim"] }
|
||||
"ui.virtual.whitespace" = { fg = "grey2", modifiers = [ "italic" ] }
|
||||
"ui.virtual.wrap" = { fg = "grey2", modifiers = [ "italic" ] }
|
||||
|
||||
"hint" = "blue"
|
||||
"info" = "aqua"
|
||||
"warning" = "yellow"
|
||||
"error" = "nasty-red"
|
||||
|
||||
"diagnostic" = { underline = { style = "curl", color = "purple" } }
|
||||
"diagnostic.hint" = { underline = { style = "curl", color = "blue" } }
|
||||
"diagnostic.info" = { underline = { style = "curl", color = "aqua" } }
|
||||
"diagnostic.warning" = { underline = { style = "curl", color = "yellow" } }
|
||||
|
@ -66,8 +83,8 @@
|
|||
"diagnostic.unnecessary" = { modifiers = ["dim"] }
|
||||
"diagnostic.deprecated" = { modifiers = ["crossed_out"] }
|
||||
|
||||
"diff.plus" = { fg = "bg_green" }
|
||||
"diff.delta" = { fg = "bg_blue" }
|
||||
"diff.plus" = { fg = "bg-green" }
|
||||
"diff.delta" = { fg = "bg-blue" }
|
||||
"diff.minus" = { fg = "nasty-red" }
|
||||
|
||||
"markup.heading" = { fg = "purple", modifiers = ["bold"] }
|
||||
|
@ -82,18 +99,17 @@
|
|||
|
||||
[palette]
|
||||
|
||||
bg0 = "#e1e1e3"
|
||||
bg01 = "#eaeaec"
|
||||
bg0 = "#d1d0c5"
|
||||
bg1 = "#494c50"
|
||||
bg2 = "#55585e"
|
||||
bg3 = "#61656b"
|
||||
bg4 = "#6d7278"
|
||||
bg5 = "#797e86"
|
||||
bg_visual = "#646669"
|
||||
bg_red = "#7e2a33"
|
||||
bg_green = "#86b365"
|
||||
bg_blue = "#6a89af"
|
||||
bg_yellow = "#e2b714"
|
||||
bg-visual = "#646669"
|
||||
bg-red = "#7e2a33"
|
||||
bg-green = "#86b365"
|
||||
bg-blue = "#6a89af"
|
||||
bg-yellow = "#e2b714"
|
||||
|
||||
fg = "#323437"
|
||||
red = "#621d28"
|
||||
|
@ -101,10 +117,11 @@ nasty-red = "#da3333"
|
|||
dark-red = "#791717"
|
||||
orange = "#57320f"
|
||||
yellow = "#9a7d0e"
|
||||
green = "#3f4b34"
|
||||
pale-yellow = "#e2b714"
|
||||
green = "#3d5128"
|
||||
aqua = "#455054"
|
||||
blue = "#3f5673"
|
||||
purple = "#534059"
|
||||
purple = "#5a4066"
|
||||
grey0 = "#aaaeb3"
|
||||
grey1 = "#e1e1e3"
|
||||
grey2 = "#646669"
|
||||
|
|
|
@ -64,6 +64,7 @@
|
|||
"ui.help" = { bg = "bg1", fg = "fg1" }
|
||||
"ui.text" = { fg = "fg1" }
|
||||
"ui.text.focus" = { fg = "fg1", modifiers = ["bold"] }
|
||||
"ui.text.directory" = { fg = "theme_blue" }
|
||||
"ui.selection" = { bg = "hl2" }
|
||||
"ui.selection.primary" = { bg = "hl1" }
|
||||
"ui.cursor.primary" = { modifiers = ["reversed"] }
|
||||
|
|
|
@ -85,7 +85,7 @@ hint = { fg = "hint" }
|
|||
"ui.statusline.normal" = { bg = "blue", fg = "bg", modifiers = ["bold"] }
|
||||
"ui.statusline.insert" = { bg = "light-green", fg = "bg", modifiers = ["bold"] }
|
||||
"ui.statusline.select" = { bg = "magenta", fg = "bg", modifiers = ["bold"] }
|
||||
"ui.text" = { bg = "bg", fg = "fg" }
|
||||
"ui.text" = { fg = "fg" }
|
||||
"ui.text.focus" = { bg = "bg-focus" }
|
||||
"ui.text.inactive" = { fg = "comment", modifiers = ["italic"] }
|
||||
"ui.text.info" = { bg = "bg-menu", fg = "fg" }
|
||||
|
|
Loading…
Reference in New Issue