Merge branch 'master' of github.com:helix-editor/helix

imgbot
trivernis 2 years ago
commit 2da81760f5
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -4,6 +4,18 @@ on:
tags:
- '[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+'
branches:
- 'patch/ci-release-*'
pull_request:
paths:
- '.github/workflows/release.yml'
env:
# Preview mode: Publishes the build output as a CI artifact instead of creating
# a release, allowing for manual inspection of the output. This mode is
# activated if the CI run was triggered by events other than pushed tags, or
# if the repository is a fork.
preview: ${{ !startsWith(github.ref, 'refs/tags/') || github.repository != 'helix-editor/helix' }}
jobs:
fetch-grammars:
@ -49,11 +61,16 @@ jobs:
rust: stable
target: x86_64-unknown-linux-gnu
cross: false
# - build: aarch64-linux
# os: ubuntu-20.04
# rust: stable
# target: aarch64-unknown-linux-gnu
# cross: true
- build: aarch64-linux
os: ubuntu-20.04
rust: stable
target: aarch64-unknown-linux-gnu
cross: true
- build: riscv64-linux
os: ubuntu-20.04
rust: stable
target: riscv64gc-unknown-linux-gnu
cross: true
- build: x86_64-macos
os: macos-latest
rust: stable
@ -100,6 +117,14 @@ jobs:
target: ${{ matrix.target }}
override: true
# Install a pre-release version of Cross
# TODO: We need to pre-install Cross because we need cross-rs/cross#591 to
# get a newer C++ compiler toolchain. Remove this step when Cross
# 0.3.0, which includes cross-rs/cross#591, is released.
- name: Install Cross
if: "matrix.cross"
run: cargo install cross --git https://github.com/cross-rs/cross.git --rev 47df5c76e7cba682823a0b6aa6d95c17b31ba63a
- name: Run cargo test
uses: actions-rs/cargo@v1
if: "!matrix.skip_tests"
@ -108,6 +133,14 @@ jobs:
command: test
args: --release --locked --target ${{ matrix.target }} --workspace
- name: Set profile.release.strip = true
shell: bash
run: |
cat >> .cargo/config.toml <<EOF
[profile.release]
strip = true
EOF
- name: Build release binary
uses: actions-rs/cargo@v1
with:
@ -115,22 +148,9 @@ jobs:
command: build
args: --release --locked --target ${{ matrix.target }}
- name: Strip release binary (linux and macos)
if: matrix.build == 'x86_64-linux' || endsWith(matrix.build, 'macos')
run: strip "target/${{ matrix.target }}/release/hx"
- name: Strip release binary (arm)
if: matrix.build == 'aarch64-linux'
run: |
docker run --rm -v \
"$PWD/target:/target:Z" \
rustembedded/cross:${{ matrix.target }} \
aarch64-linux-gnu-strip \
/target/${{ matrix.target }}/release/hx
- name: Build AppImage
shell: bash
if: matrix.build == 'x86_64-linux'
if: matrix.build == 'aarch64-linux' || matrix.build == 'x86_64-linux'
run: |
mkdir dist
@ -139,8 +159,10 @@ jobs:
name=${GITHUB_REF:10}
fi
build="${{ matrix.build }}"
export VERSION="$name"
export ARCH=x86_64
export ARCH=${build%-linux}
export APP=helix
export OUTPUT="helix-$VERSION-$ARCH.AppImage"
export UPDATE_INFORMATION="gh-releases-zsync|$GITHUB_REPOSITORY_OWNER|helix|latest|$APP-*-$ARCH.AppImage.zsync"
@ -237,7 +259,7 @@ jobs:
mv bins-$platform/hx$exe $pkgname
chmod +x $pkgname/hx$exe
if [[ "$platform" = "x86_64-linux" ]]; then
if [[ "$platform" = "aarch64-linux" || "$platform" = "x86_64-linux" ]]; then
mv bins-$platform/helix-*.AppImage* dist/
fi
@ -253,9 +275,17 @@ jobs:
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
if: env.preview == 'false'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*
file_glob: true
tag: ${{ steps.tagname.outputs.val }}
overwrite: true
- name: Upload binaries as artifact
uses: actions/upload-artifact@v3
if: env.preview == 'true'
with:
name: release
path: dist/*

@ -684,7 +684,7 @@ Usability improvements and fixes:
- File picker configuration ([#988](https://github.com/helix-editor/helix/pull/988))
- Fix surround cursor position calculation ([#1183](https://github.com/helix-editor/helix/pull/1183))
- Accept count for goto_window ([#1033](https://github.com/helix-editor/helix/pull/1033))
- Make kill_to_line_end behave like emacs ([#1235](https://github.com/helix-editor/helix/pull/1235))
- Make kill_to_line_end behave like Emacs ([#1235](https://github.com/helix-editor/helix/pull/1235))
- Only use a single documentation popup ([#1241](https://github.com/helix-editor/helix/pull/1241))
- ui: popup: Don't allow scrolling past the end of content ([`3307f44c`](https://github.com/helix-editor/helix/commit/3307f44c))
- Open files with spaces in filename, allow opening multiple files ([#1231](https://github.com/helix-editor/helix/pull/1231))
@ -922,7 +922,7 @@ to distinguish it in bug reports..
on cargo run. `~/.config/helix/runtime` can also be used.
- Registers can now be selected via " (for example `"ay`)
- Support for Nix files was added
- Movement is now fully tested and matches kakoune implementation
- Movement is now fully tested and matches Kakoune implementation
- A per-file LSP symbol picker was added to space+s
- Selection can be replaced with yanked text via R
@ -946,7 +946,7 @@ Keymaps:
- The runtime/ can now optionally be embedded in the binary
- Haskell syntax added
- Window mode (ctrl-w) added
- Show matching bracket (vim's matchbrackets)
- Show matching bracket (Vim's matchbrackets)
- Themes now support style modifiers
- First user contributed theme
- Create a document if it doesn't exist yet on save

49
Cargo.lock generated

@ -22,9 +22,9 @@ dependencies = [
[[package]]
name = "anyhow"
version = "1.0.63"
version = "1.0.64"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a26fa4d7e3f2eebadf743988fc8aec9fa9a9e82611acafd77c1462ed6262440a"
checksum = "b9a8f622bcf6ff3df478e9deba3e03e4e04b300f8e6a139e192c05fa3490afc7"
[[package]]
name = "arc-swap"
@ -268,11 +268,10 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
name = "form_urlencoded"
version = "1.0.1"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191"
checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8"
dependencies = [
"matches",
"percent-encoding",
]
@ -564,11 +563,10 @@ dependencies = [
[[package]]
name = "idna"
version = "0.2.3"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8"
checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6"
dependencies = [
"matches",
"unicode-bidi",
"unicode-normalization",
]
@ -675,12 +673,6 @@ dependencies = [
"url",
]
[[package]]
name = "matches"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
[[package]]
name = "memchr"
version = "2.5.0"
@ -739,9 +731,9 @@ dependencies = [
[[package]]
name = "once_cell"
version = "1.13.1"
version = "1.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e"
checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0"
[[package]]
name = "parking_lot"
@ -768,9 +760,9 @@ dependencies = [
[[package]]
name = "percent-encoding"
version = "2.1.0"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"
[[package]]
name = "pin-project-lite"
@ -1126,18 +1118,18 @@ dependencies = [
[[package]]
name = "thiserror"
version = "1.0.33"
version = "1.0.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d0a539a918745651435ac7db7a18761589a94cd7e94cd56999f828bf73c8a57"
checksum = "8c1b05ca9d106ba7d2e31a9dab4a64e7be2cce415321966ea3132c49a656e252"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.33"
version = "1.0.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c251e90f708e16c49a16f4917dc2131e75222b72edfa9cb7f7c58ae56aae0c09"
checksum = "e8f2591983642de85c921015f3f070c665a197ed69e417af436115e3a1407487"
dependencies = [
"proc-macro2",
"quote",
@ -1179,9 +1171,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
[[package]]
name = "tokio"
version = "1.20.1"
version = "1.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a8325f63a7d4774dd041e363b2409ed1c5cbbd0f867795e661df066b2b0a581"
checksum = "89797afd69d206ccd11fb0ea560a44bbb87731d020670e79416d442919257d42"
dependencies = [
"autocfg",
"bytes",
@ -1231,9 +1223,9 @@ dependencies = [
[[package]]
name = "tree-sitter"
version = "0.20.8"
version = "0.20.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "268bf3e3ca0c09e5d21b59c2638e12cb6dcf7ea2681250a696a2d0936cb57ba0"
checksum = "d4423c784fe11398ca91e505cdc71356b07b1a924fc8735cfab5333afe3e18bc"
dependencies = [
"cc",
"regex",
@ -1298,13 +1290,12 @@ checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
[[package]]
name = "url"
version = "2.2.2"
version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c"
checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643"
dependencies = [
"form_urlencoded",
"idna",
"matches",
"percent-encoding",
"serde",
]

@ -4,10 +4,10 @@
![Screenshot](./screenshot.png)
A kakoune / neovim inspired editor, written in Rust.
A Kakoune / Neovim inspired editor, written in Rust.
The editing model is very heavily based on kakoune; during development I found
myself agreeing with most of kakoune's design decisions.
The editing model is very heavily based on Kakoune; during development I found
myself agreeing with most of Kakoune's design decisions.
For more information, see the [website](https://helix-editor.com) or
[documentation](https://docs.helix-editor.com/).
@ -24,7 +24,7 @@ All shortcuts/keymaps can be found [in the documentation on the website](https:/
- Smart, incremental syntax highlighting and code editing via tree-sitter
It's a terminal-based editor first, but I'd like to explore a custom renderer
(similar to emacs) in wgpu or skulpin.
(similar to Emacs) in wgpu or skulpin.
Note: Only certain languages have indentation definitions at the moment. Check
`runtime/queries/<lang>/` for `indents.scm`.
@ -50,8 +50,8 @@ config directory (for example `~/.config/helix/runtime` on Linux/macOS, or `%App
| OS | Command |
| -------------------- | -------------------------------------------- |
| Windows (cmd.exe) | `xcopy /e runtime %AppData%\helix\runtime` |
| Windows (PowerShell) | `xcopy /e runtime $Env:AppData\helix\runtime` |
| Windows (cmd.exe) | `xcopy /e /i runtime %AppData%\helix\runtime` |
| Windows (PowerShell) | `xcopy /e /i runtime $Env:AppData\helix\runtime` |
| Linux/macOS | `ln -s $PWD/runtime ~/.config/helix/runtime` |
This location can be overridden via the `HELIX_RUNTIME` environment variable.

@ -11,7 +11,6 @@
- [Configuration](./configuration.md)
- [Themes](./themes.md)
- [Key Remapping](./remapping.md)
- [Hooks](./hooks.md)
- [Languages](./languages.md)
- [Guides](./guides/README.md)
- [Adding Languages](./guides/adding_languages.md)

@ -1,5 +1,5 @@
# Commands
Command mode can be activated by pressing `:`, similar to vim. Built-in commands:
Command mode can be activated by pressing `:`, similar to Vim. Built-in commands:
{{#include ./generated/typable-cmd.md}}

@ -1,7 +1,7 @@
# Migrating from Vim
Helix's editing model is strongly inspired from vim and kakoune, and a notable
difference from vim (and the most striking similarity to kakoune) is that Helix
Helix's editing model is strongly inspired from Vim and Kakoune, and a notable
difference from Vim (and the most striking similarity to Kakoune) is that Helix
follows the `selection → action` model. This means that the whatever you are
going to act on (a word, a paragraph, a line, etc) is selected first and the
action itself (delete, change, yank, etc) comes second. A cursor is simply a

@ -1,5 +1,6 @@
| Language | Syntax Highlighting | Treesitter Textobjects | Auto Indent | Default LSP |
| --- | --- | --- | --- | --- |
| astro | ✓ | | | |
| awk | ✓ | ✓ | | `awk-language-server` |
| bash | ✓ | | | `bash-language-server` |
| beancount | ✓ | | | |
@ -15,6 +16,7 @@
| cue | ✓ | | | `cuelsp` |
| dart | ✓ | | ✓ | `dart` |
| devicetree | ✓ | | | |
| diff | ✓ | | | |
| dockerfile | ✓ | | | `docker-langserver` |
| dot | ✓ | | | `dot-language-server` |
| edoc | ✓ | | | |
@ -28,16 +30,16 @@
| esdl | ✓ | | | |
| fish | ✓ | ✓ | ✓ | |
| fortran | ✓ | | ✓ | `fortls` |
| gdscript | ✓ | | | |
| gdscript | ✓ | | | |
| git-attributes | ✓ | | | |
| git-commit | ✓ | | | |
| git-config | ✓ | | | |
| git-diff | ✓ | | | |
| git-ignore | ✓ | | | |
| git-rebase | ✓ | | | |
| gleam | ✓ | ✓ | | `gleam` |
| glsl | ✓ | ✓ | ✓ | |
| go | ✓ | ✓ | ✓ | `gopls` |
| godot-resource | ✓ | | | |
| gomod | ✓ | | | `gopls` |
| gotmpl | ✓ | | | `gopls` |
| gowork | ✓ | | | `gopls` |
@ -53,6 +55,7 @@
| javascript | ✓ | ✓ | ✓ | `typescript-language-server` |
| jsdoc | ✓ | | | |
| json | ✓ | | ✓ | `vscode-json-language-server` |
| jsonnet | ✓ | | | `jsonnet-language-server` |
| jsx | ✓ | ✓ | ✓ | `typescript-language-server` |
| julia | ✓ | | | `julia` |
| kotlin | ✓ | | | `kotlin-language-server` |
@ -74,7 +77,7 @@
| ocaml | ✓ | | ✓ | `ocamllsp` |
| ocaml-interface | ✓ | | | `ocamllsp` |
| odin | ✓ | | | `ols` |
| openscad | ✓ | | | `openscad-language-server` |
| openscad | ✓ | | | `openscad-lsp` |
| org | ✓ | | | |
| pascal | ✓ | ✓ | | `pasls` |
| perl | ✓ | ✓ | ✓ | |
@ -95,6 +98,7 @@
| scheme | ✓ | | | |
| scss | ✓ | | | `vscode-css-language-server` |
| slint | ✓ | | ✓ | `slint-lsp` |
| sml | ✓ | | | |
| solidity | ✓ | | | `solc` |
| sql | ✓ | | | |
| sshclientconfig | ✓ | | | |

@ -29,7 +29,7 @@ language with the path `runtime/queries/<name>/`. The tree-sitter
gives more info on how to write queries.
> NOTE: When evaluating queries, the first matching query takes
precedence, which is different from other editors like neovim where
precedence, which is different from other editors like Neovim where
the last matching query supersedes the ones before it. See
[this issue][neovim-query-precedence] for an example.

@ -66,8 +66,8 @@ via the `HELIX_RUNTIME` environment variable.
| OS | command |
|-------------------|-----------|
|windows(cmd.exe) |`xcopy /e runtime %AppData%/helix/runtime` |
|windows(powershell)|`xcopy /e runtime $Env:AppData\helix\runtime` |
|windows(cmd.exe) |`xcopy /e /i runtime %AppData%/helix/runtime` |
|windows(powershell)|`xcopy /e /i runtime $Env:AppData\helix\runtime` |
|linux/macos |`ln -s $PWD/runtime ~/.config/helix/runtime`|
## Finishing up the installation

@ -27,7 +27,7 @@
### Movement
> NOTE: Unlike vim, `f`, `F`, `t` and `T` are not confined to the current line.
> NOTE: Unlike Vim, `f`, `F`, `t` and `T` are not confined to the current line.
| Key | Description | Command |
| ----- | ----------- | ------- |
@ -229,7 +229,7 @@ TODO: Mappings for selecting syntax nodes (a superset of `[`).
#### Window mode
This layer is similar to vim keybindings as kakoune does not support window.
This layer is similar to Vim keybindings as Kakoune does not support window.
| Key | Description | Command |
| ----- | ------------- | ------- |
@ -257,6 +257,7 @@ This layer is a kludge of mappings, mostly pickers.
| Key | Description | Command |
| ----- | ----------- | ------- |
| `f` | Open file picker | `file_picker` |
| `F` | Open file picker at current working directory | `file_picker_in_current_directory` |
| `b` | Open buffer picker | `buffer_picker` |
| `j` | Open jumplist picker | `jumplist_picker` |
| `k` | Show documentation for item under cursor in a [popup](#popup) (**LSP**) | `hover` |
@ -316,10 +317,12 @@ Mappings in the style of [vim-unimpaired](https://github.com/tpope/vim-unimpaire
## Insert Mode
We support many readline/emacs style bindings in insert mode for
convenience. These can be helpful for making simple modifications
without escaping to normal mode, but beware that you will not have an
undo-able "save point" until you return to normal mode.
Insert mode bindings are somewhat minimal by default. Helix is designed to
be a modal editor, and this is reflected in the user experience and internal
mechanics. For example, changes to the text are only saved for undos when
escaping from insert mode to normal mode. For this reason, new users are
strongly encouraged to learn the modal editing paradigm to get the smoothest
experience.
| Key | Description | Command |
| ----- | ----------- | ------- |
@ -328,23 +331,38 @@ undo-able "save point" until you return to normal mode.
| `Ctrl-r` | Insert a register content | `insert_register` |
| `Ctrl-w`, `Alt-Backspace`, `Ctrl-Backspace` | Delete previous word | `delete_word_backward` |
| `Alt-d`, `Alt-Delete`, `Ctrl-Delete` | Delete next word | `delete_word_forward` |
| `Alt-b`, `Ctrl-Left` | Backward a word | `move_prev_word_end` |
| `Ctrl-b`, `Left` | Backward a char | `move_char_left` |
| `Alt-f`, `Ctrl-Right` | Forward a word | `move_next_word_start` |
| `Ctrl-f`, `Right` | Forward a char | `move_char_right` |
| `Ctrl-e`, `End` | Move to line end | `goto_line_end_newline` |
| `Ctrl-a`, `Home` | Move to line start | `goto_line_start` |
| `Ctrl-u` | Delete to start of line | `kill_to_line_start` |
| `Ctrl-k` | Delete to end of line | `kill_to_line_end` |
| `Ctrl-j`, `Enter` | Insert new line | `insert_newline` |
| `Backspace`, `Ctrl-h` | Delete previous char | `delete_char_backward` |
| `Delete`, `Ctrl-d` | Delete next char | `delete_char_forward` |
| `Ctrl-p`, `Up` | Move to previous line | `move_line_up` |
| `Ctrl-n`, `Down` | Move to next line | `move_line_down` |
| `PageUp` | Move one page up | `page_up` |
| `PageDown` | Move one page down | `page_down` |
| `Alt->` | Go to end of buffer | `goto_file_end` |
| `Alt-<` | Go to start of buffer | `goto_file_start` |
However, if you really want navigation in insert mode, this is supported. An
example config that gives the ability to use arrow keys while still in insert
mode:
```toml
[keys.insert]
"up" = "move_line_up"
"down" = "move_line_down"
"left" = "move_char_left"
"right" = "move_char_right"
"C-b" = "move_char_left"
"C-f" = "move_char_right"
"A-b" = "move_prev_word_end"
"C-left" = "move_prev_word_end"
"A-f" = "move_next_word_start"
"C-right" = "move_next_word_start"
"A-<" = "goto_file_start"
"A->" = "goto_file_end"
"pageup" = "page_up"
"pagedown" = "page_down"
"home" = "goto_line_start"
"C-a" = "goto_line_start"
"end" = "goto_line_end_newline"
"C-e" = "goto_line_end_newline"
"A-left" = "goto_line_start"
```
## Select / extend mode

@ -2,7 +2,7 @@
(Currently not fully documented, see the [keymappings](./keymap.md) list for more.)
See [tutor.txt](https://github.com/helix-editor/helix/blob/master/runtime/tutor.txt) (accessible via `hx --tutor` or `:tutor`) for a vimtutor-like introduction.
See [tutor](https://github.com/helix-editor/helix/blob/master/runtime/tutor) (accessible via `hx --tutor` or `:tutor`) for a vimtutor-like introduction.
## Registers
@ -125,18 +125,17 @@ will move the selection over to the "func" `identifier`.
## Textobjects
Currently supported: `word`, `surround`, `function`, `class`, `parameter`.
![textobject-demo](https://user-images.githubusercontent.com/23398472/124231131-81a4bb00-db2d-11eb-9d10-8e577ca7b177.gif)
![textobject-treesitter-demo](https://user-images.githubusercontent.com/23398472/132537398-2a2e0a54-582b-44ab-a77f-eb818942203d.gif)
- `ma` - Select around the object (`va` in vim, `<alt-a>` in kakoune)
- `mi` - Select inside the object (`vi` in vim, `<alt-i>` in kakoune)
- `ma` - Select around the object (`va` in Vim, `<alt-a>` in Kakoune)
- `mi` - Select inside the object (`vi` in Vim, `<alt-i>` in Kakoune)
| Key after `mi` or `ma` | Textobject selected |
| --- | --- |
| `w` | Word |
| `W` | WORD |
| `p` | Paragraph |
| `(`, `[`, `'`, etc | Specified surround pairs |
| `m` | Closest surround pair |
| `f` | Function |

@ -92,8 +92,9 @@
prev.packages
++ (
with common.pkgs;
[lld_13 lldb cargo-flamegraph rust-analyzer]
[lld_13 cargo-flamegraph rust-analyzer]
++ (lib.optional (stdenv.isx86_64 && stdenv.isLinux) cargo-tarpaulin)
++ (lib.optional stdenv.isLinux lldb)
);
env =
prev.env

@ -26,7 +26,7 @@ unicode-general-category = "0.5"
# slab = "0.4.2"
slotmap = "1.0"
tree-sitter = "0.20"
once_cell = "1.13"
once_cell = "1.14"
arc-swap = "1"
regex = "1"

@ -270,7 +270,7 @@ pub enum WordMotionTarget {
NextWordEnd,
PrevWordStart,
PrevWordEnd,
// A "Long word" (also known as a WORD in vim/kakoune) is strictly
// A "Long word" (also known as a WORD in Vim/Kakoune) is strictly
// delimited by whitespace, and can consist of punctuation as well
// as alphanumerics.
NextLongWordStart,

@ -985,7 +985,9 @@ impl LanguageLayer {
}
fn parse(&mut self, parser: &mut Parser, source: &Rope) -> Result<(), Error> {
parser.set_included_ranges(&self.ranges).unwrap();
parser
.set_included_ranges(&self.ranges)
.map_err(|_| Error::InvalidRanges)?;
parser
.set_language(self.config.language)
@ -1135,6 +1137,7 @@ pub struct Highlight(pub usize);
pub enum Error {
Cancelled,
InvalidLanguage,
InvalidRanges,
Unknown,
}

@ -19,7 +19,7 @@ serde = { version = "1.0", features = ["derive"] }
toml = "0.5"
etcetera = "0.4"
tree-sitter = "0.20"
once_cell = "1.13"
once_cell = "1.14"
log = "0.4"
# TODO: these two should be on !wasm32 only

@ -139,7 +139,7 @@ pub fn fetch_grammars() -> Result<()> {
let len = errors.len();
println!("{} grammars failed to fetch", len);
for (i, error) in errors.into_iter().enumerate() {
println!("\tFailure {}/{}: {}", i, len, error);
println!("\tFailure {}/{}: {}", i + 1, len, error);
}
}

@ -42,8 +42,10 @@ pub fn runtime_dir() -> PathBuf {
}
// fallback to location of the executable being run
// canonicalize the path in case the executable is symlinked
std::env::current_exe()
.ok()
.and_then(|path| std::fs::canonicalize(path).ok())
.and_then(|path| path.parent().map(|path| path.to_path_buf().join(RT_DIR)))
.unwrap()
}

@ -22,6 +22,6 @@ lsp-types = { version = "0.93", features = ["proposed"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "1.0"
tokio = { version = "1.19", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot", "sync"] }
tokio = { version = "1.21", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot", "sync"] }
tokio-stream = "0.1.9"
which = "4.2"

@ -38,8 +38,6 @@ pub enum Error {
Timeout,
#[error("server closed the stream")]
StreamClosed,
#[error("LSP not defined")]
LspNotDefined,
#[error("Unhandled")]
Unhandled,
#[error(transparent)]
@ -320,14 +318,14 @@ impl Registry {
.map(|(_, client)| client.as_ref())
}
pub fn get(&mut self, language_config: &LanguageConfiguration) -> Result<Arc<Client>> {
pub fn get(&mut self, language_config: &LanguageConfiguration) -> Result<Option<Arc<Client>>> {
let config = match &language_config.language_server {
Some(config) => config,
None => return Err(Error::LspNotDefined),
None => return Ok(None),
};
match self.inner.entry(language_config.scope.clone()) {
Entry::Occupied(entry) => Ok(entry.get().1.clone()),
Entry::Occupied(entry) => Ok(Some(entry.get().1.clone())),
Entry::Vacant(entry) => {
// initialize a new client
let id = self.counter.fetch_add(1, Ordering::Relaxed);
@ -370,7 +368,7 @@ impl Registry {
});
entry.insert((id, client.clone()));
Ok(client)
Ok(Some(client))
}
}
}

@ -32,7 +32,7 @@ helix-dap = { version = "0.6", path = "../helix-dap" }
helix-loader = { version = "0.6", path = "../helix-loader" }
anyhow = "1"
once_cell = "1.13"
once_cell = "1.14"
which = "4.2"

@ -157,7 +157,7 @@ impl Application {
compositor.push(editor_view);
if args.load_tutor {
let path = helix_loader::runtime_dir().join("tutor.txt");
let path = helix_loader::runtime_dir().join("tutor");
editor.open(&path, Action::VerticalSplit)?;
// Unset path to prevent accidentally saving to the original tutor file.
doc_mut!(editor).set_path(None)?;
@ -366,29 +366,39 @@ impl Application {
self.editor.refresh_config();
}
fn refresh_config(&mut self) {
let config = Config::load_default().unwrap_or_else(|err| {
self.editor.set_error(err.to_string());
Config::default()
});
// Refresh theme
/// Refresh theme after config change
fn refresh_theme(&mut self, config: &Config) {
if let Some(theme) = config.theme.clone() {
let true_color = self.true_color();
self.editor.set_theme(
self.theme_loader
.load(&theme)
.map_err(|e| {
log::warn!("failed to load theme `{}` - {}", theme, e);
e
})
.ok()
.filter(|theme| (true_color || theme.is_16_color()))
.unwrap_or_else(|| self.theme_loader.default_theme(true_color)),
);
match self.theme_loader.load(&theme) {
Ok(theme) => {
if true_color || theme.is_16_color() {
self.editor.set_theme(theme);
} else {
self.editor
.set_error("theme requires truecolor support, which is not available");
}
}
Err(err) => {
let err_string = format!("failed to load theme `{}` - {}", theme, err);
self.editor.set_error(err_string);
}
}
}
}
self.config.store(Arc::new(config));
fn refresh_config(&mut self) {
match Config::load_default() {
Ok(config) => {
self.refresh_theme(&config);
// Store new config
self.config.store(Arc::new(config));
}
Err(err) => {
self.editor.set_error(err.to_string());
}
}
}
fn true_color(&self) -> bool {

@ -1974,7 +1974,7 @@ fn extend_line_impl(cx: &mut Context, extend: Extend) {
let (start_line, end_line) = range.line_range(text.slice(..));
let start = text.line_to_char(match extend {
Extend::Above => start_line.saturating_sub(count),
Extend::Above => start_line.saturating_sub(count - 1),
Extend::Below => start_line,
});
let end = text.line_to_char(
@ -1988,7 +1988,7 @@ fn extend_line_impl(cx: &mut Context, extend: Extend) {
// extend to previous/next line if current line is selected
let (anchor, head) = if range.from() == start && range.to() == end {
match extend {
Extend::Above => (end, text.line_to_char(start_line.saturating_sub(count + 1))),
Extend::Above => (end, text.line_to_char(start_line.saturating_sub(count))),
Extend::Below => (
start,
text.line_to_char((end_line + count + 1).min(text.len_lines())),
@ -4182,12 +4182,16 @@ fn split(cx: &mut Context, action: Action) {
let (view, doc) = current!(cx.editor);
let id = doc.id();
let selection = doc.selection(view.id).clone();
let offset = view.offset;
cx.editor.switch(id, action);
// match the selection in the previous view
let (view, doc) = current!(cx.editor);
doc.set_selection(view.id, selection);
// match the view scroll offset (switch doesn't handle this fully
// since the selection is only matched after the split)
view.offset = offset;
}
fn hsplit(cx: &mut Context) {

@ -491,8 +491,7 @@ pub fn code_action(cx: &mut Context) {
});
picker.move_down(); // pre-select the first item
let popup =
Popup::new("code-action", picker).margin(helix_view::graphics::Margin::all(1));
let popup = Popup::new("code-action", picker);
compositor.replace_or_push("code-action", popup);
},
)

@ -1147,7 +1147,7 @@ fn tutor(
return Ok(());
}
let path = helix_loader::runtime_dir().join("tutor.txt");
let path = helix_loader::runtime_dir().join("tutor");
cx.editor.open(&path, Action::Replace)?;
// Unset path to prevent accidentally saving to the original tutor file.
doc_mut!(cx.editor).set_path(None)?;
@ -1253,7 +1253,12 @@ fn language(
}
let doc = doc_mut!(cx.editor);
doc.set_language_by_language_id(&args[0], cx.editor.syn_loader.clone());
if args[0] == "text" {
doc.set_language(None, None)
} else {
doc.set_language_by_language_id(&args[0], cx.editor.syn_loader.clone())?;
}
doc.detect_indent_and_line_ending();
let id = doc.id();
@ -1324,6 +1329,7 @@ fn reflow(
return Ok(());
}
let scrolloff = cx.editor.config().scrolloff;
let (view, doc) = current!(cx.editor);
const DEFAULT_MAX_LEN: usize = 79;
@ -1354,6 +1360,7 @@ fn reflow(
doc.apply(&transaction, view.id);
doc.append_changes_to_history(view.id);
view.ensure_cursor_in_view(doc, scrolloff);
Ok(())
}

@ -357,25 +357,6 @@ pub fn default() -> HashMap<Mode, Keymap> {
"A-del" => delete_word_forward,
"C-s" => commit_undo_checkpoint,
"left" => move_char_left,
"C-b" => move_char_left,
"down" => move_line_down,
"up" => move_line_up,
"right" => move_char_right,
"C-f" => move_char_right,
"A-b" => move_prev_word_end,
"C-left" => move_prev_word_end,
"A-f" => move_next_word_start,
"C-right" => move_next_word_start,
"A-<" => goto_file_start,
"A->" => goto_file_end,
"pageup" => page_up,
"pagedown" => page_down,
"home" => goto_line_start,
"C-a" => goto_line_start,
"end" => goto_line_end_newline,
"C-e" => goto_line_end_newline,
"C-k" => kill_to_line_end,
"C-u" => kill_to_line_start,

@ -1323,6 +1323,7 @@ impl Component for EditorView {
if cx.editor.should_close() {
return EventResult::Ignored(None);
}
// if the focused view still exists and wasn't closed
if cx.editor.tree.contains(focus) {
let config = cx.editor.config();

@ -178,6 +178,21 @@ impl Markdown {
.map(|key| get_theme(key))
.collect();
// Transform text in `<code>` blocks into `Event::Code`
let mut in_code = false;
let parser = parser.filter_map(|event| match event {
Event::Html(tag) if *tag == *"<code>" => {
in_code = true;
None
}
Event::Html(tag) if *tag == *"</code>" => {
in_code = false;
None
}
Event::Text(text) if in_code => Some(Event::Code(text)),
_ => Some(event),
});
for event in parser {
match event {
Event::Start(Tag::List(list)) => {

@ -334,13 +334,19 @@ pub mod completers {
pub fn language(editor: &Editor, input: &str) -> Vec<Completion> {
let matcher = Matcher::default();
let mut matches: Vec<_> = editor
let text: String = "text".into();
let language_ids = editor
.syn_loader
.language_configs()
.filter_map(|config| {
.map(|config| &config.language_id)
.chain(std::iter::once(&text));
let mut matches: Vec<_> = language_ids
.filter_map(|language_id| {
matcher
.fuzzy_match(&config.language_id, input)
.map(|score| (&config.language_id, score))
.fuzzy_match(language_id, input)
.map(|score| (language_id, score))
})
.collect();

@ -22,7 +22,7 @@ helix-dap = { version = "0.6", path = "../helix-dap" }
crossterm = { version = "0.25", optional = true }
# Conversion traits
once_cell = "1.13"
once_cell = "1.14"
url = "2"
arc-swap = { version = "1.5.1" }

@ -543,12 +543,19 @@ impl Document {
}
if let Some(fmt) = formatting {
let transaction = fmt.await?;
let success = transaction.changes().apply(&mut text);
if !success {
// This shouldn't happen, because the transaction changes were generated
// from the same text we're saving.
log::error!("failed to apply format changes before saving");
match fmt.await {
Ok(transaction) => {
let success = transaction.changes().apply(&mut text);
if !success {
// This shouldn't happen, because the transaction changes were generated
// from the same text we're saving.
log::error!("failed to apply format changes before saving");
}
}
Err(err) => {
// formatting failed: report error, and save file without modifications
log::error!("{}", err);
}
}
}
@ -676,9 +683,12 @@ impl Document {
&mut self,
language_id: &str,
config_loader: Arc<syntax::Loader>,
) {
let language_config = config_loader.language_config_for_language_id(language_id);
self.set_language(language_config, Some(config_loader));
) -> anyhow::Result<()> {
let language_config = config_loader
.language_config_for_language_id(language_id)
.ok_or_else(|| anyhow!("invalid language id: {}", language_id))?;
self.set_language(Some(language_config), Some(config_loader));
Ok(())
}
/// Set the LSP.

@ -936,6 +936,7 @@ impl Editor {
)
})
.ok()
.flatten()
});
if let Some(language_server) = language_server {
// only spawn a new lang server if the servers aren't the same

@ -121,7 +121,7 @@ indent = { tab-width = 4, unit = " " }
[[grammar]]
name = "fish"
source = { git = "https://github.com/ram02z/tree-sitter-fish", rev = "04e54ab6585dfd4fee6ddfe5849af56f101b6d4f" }
source = { git = "https://github.com/ram02z/tree-sitter-fish", rev = "84436cf24c2b3176bfbb220922a0fdbd0141e406" }
[[language]]
name = "mint"
@ -331,8 +331,8 @@ source = { git = "https://github.com/omertuc/tree-sitter-go-work", rev = "6dd9dd
[[language]]
name = "javascript"
scope = "source.js"
injection-regex = "^(js|javascript)$"
file-types = ["js", "jsx", "mjs", "cjs"]
injection-regex = "(js|javascript)"
file-types = ["js", "mjs", "cjs"]
shebangs = ["node"]
roots = []
comment-token = "//"
@ -363,14 +363,14 @@ injection-regex = "jsx"
file-types = ["jsx"]
roots = []
comment-token = "//"
language-server = { command = "typescript-language-server", args = ["--stdio"], language-id = "javascript" }
language-server = { command = "typescript-language-server", args = ["--stdio"], language-id = "javascriptreact" }
indent = { tab-width = 2, unit = " " }
grammar = "javascript"
[[language]]
name = "typescript"
scope = "source.ts"
injection-regex = "^(ts|typescript)$"
injection-regex = "(ts|typescript)"
file-types = ["ts"]
shebangs = []
roots = []
@ -385,7 +385,7 @@ source = { git = "https://github.com/tree-sitter/tree-sitter-typescript", rev =
[[language]]
name = "tsx"
scope = "source.tsx"
injection-regex = "^(tsx)$" # |typescript
injection-regex = "(tsx)" # |typescript
file-types = ["tsx"]
roots = []
# TODO: highlights-params
@ -904,7 +904,7 @@ source = { git = "https://github.com/Flakebi/tree-sitter-tablegen", rev = "568dd
name = "markdown"
scope = "source.md"
injection-regex = "md|markdown"
file-types = ["md"]
file-types = ["md", "markdown"]
roots = []
indent = { tab-width = 2, unit = " " }
@ -972,13 +972,15 @@ roots = []
file-types = ["COMMIT_EDITMSG"]
comment-token = "#"
indent = { tab-width = 2, unit = " " }
rulers = [50, 72]
max-line-length = 72
[[grammar]]
name = "git-commit"
source = { git = "https://github.com/the-mikedavis/tree-sitter-git-commit", rev = "318dd72abfaa7b8044c1d1fbeabcd06deaaf038f" }
[[language]]
name = "git-diff"
name = "diff"
scope = "source.diff"
roots = []
file-types = ["diff"]
@ -987,8 +989,8 @@ comment-token = "#"
indent = { tab-width = 2, unit = " " }
[[grammar]]
name = "git-diff"
source = { git = "https://github.com/the-mikedavis/tree-sitter-git-diff", rev = "c12e6ecb54485f764250556ffd7ccb18f8e2942b" }
name = "diff"
source = { git = "https://github.com/the-mikedavis/tree-sitter-diff", rev = "fd74c78fa88a20085dbc7bbeaba066f4d1692b63" }
[[language]]
name = "git-rebase"
@ -1183,7 +1185,7 @@ source = { git = "https://github.com/milisims/tree-sitter-org", rev = "698bb1a34
[[language]]
name = "solidity"
scope = "source.sol"
injection-regex = "^(sol|solidity)$"
injection-regex = "(sol|solidity)"
file-types = ["sol"]
roots = []
comment-token = "//"
@ -1192,7 +1194,7 @@ language-server = { command = "solc", args = ["--lsp"] }
[[grammar]]
name = "solidity"
source = { git = "https://github.com/slinlee/tree-sitter-solidity", rev = "f3a002274744e859bf64cf3524985f8c31ea84fd" }
source = { git = "https://github.com/JoranHonig/tree-sitter-solidity", rev = "9004b86531cb424bd379424cf7266a4585f2af7d" }
[[language]]
name = "gleam"
@ -1325,12 +1327,27 @@ shebangs = []
roots = ["project.godot"]
auto-format = true
comment-token = "#"
indent = { tab-width = 4, unit = " " }
indent = { tab-width = 4, unit = "\t" }
[[grammar]]
name = "gdscript"
source = { git = "https://github.com/PrestonKnopp/tree-sitter-gdscript", rev = "2a6abdaa47fcb91397e09a97c7433fd995ea46c6" }
[[language]]
name = "godot-resource"
scope = "source.tscn"
injection-regex = "godot"
file-types = ["tscn","tres"]
shebangs = []
roots = ["project.godot"]
auto-format = false
comment-token = "#"
indent = { tab-width = 4, unit = "\t" }
[[grammar]]
name = "godot-resource"
source = { git = "https://github.com/PrestonKnopp/tree-sitter-godot-resource", rev = "b6ef0768711086a86b3297056f9ffb5cc1d77b4a" }
[[language]]
name = "nu"
scope = "source.nu"
@ -1400,7 +1417,7 @@ source = { git = "https://github.com/archseer/tree-sitter-cairo", rev = "5155c6e
[[language]]
name = "cpon"
scope = "scope.cpon"
injection-regex = "^cpon$"
injection-regex = "cpon"
file-types = ["cpon", "cp"]
roots = []
auto-format = true
@ -1521,7 +1538,7 @@ injection-regex = "openscad"
file-types = ["scad"]
roots = []
comment-token = "//"
language-server = { command = "openscad-language-server" }
language-server = { command = "openscad-lsp", args = ["--stdio"] }
indent = { tab-width = 2, unit = "\t" }
[[grammar]]
@ -1712,3 +1729,40 @@ language-server = { command = "pasls", args = [] }
[[grammar]]
name = "pascal"
source = { git = "https://github.com/Isopod/tree-sitter-pascal", rev = "2fd40f477d3e2794af152618ccfac8d92eb72a66" }
[[language]]
name = "sml"
scope = "source.sml"
injection-regex = "sml"
file-types = ["sml"]
comment-token = "(*"
roots = []
[[grammar]]
name = "sml"
source = { git = "https://github.com/Giorbo/tree-sitter-sml", rev = "bd4055d5554614520d4a0706b34dc0c317c6b608" }
[[language]]
name = "jsonnet"
scope = "source.jsonnet"
file-types = ["libsonnet", "jsonnet"]
roots = ["jsonnetfile.json"]
comment-token = "//"
indent = { tab-width = 2, unit = " " }
language-server = { command = "jsonnet-language-server", args= ["-t", "--lint"] }
[[grammar]]
name = "jsonnet"
source = { git = "https://github.com/sourcegraph/tree-sitter-jsonnet", rev = "0475a5017ad7dc84845d1d33187f2321abcb261d" }
[[language]]
name = "astro"
scope = "source.astro"
injection-regex = "astro"
file-types = ["astro"]
roots = []
indent = { tab-width = 2, unit = " " }
[[grammar]]
name = "astro"
source = { git = "https://github.com/virchau13/tree-sitter-astro", rev = "5f5c3e73c45967df9aa42f861fad2d77cd4e0900" }

@ -0,0 +1,3 @@
; inherits: html
["---"] @punctuation.delimiter

@ -0,0 +1,9 @@
; inherits: html
((frontmatter
(raw_text) @injection.content)
(#set! injection.language "typescript"))
((interpolation
(raw_text) @injection.content)
(#set! injection.language "tsx"))

@ -1,20 +1,16 @@
; Elixir Code Comments
((comment) @injection.content
(#set! injection.language "comment"))
; Elixir Regular Expressions
((sigil
(sigil_name) @_sigil_name
(quoted_content) @injection.content)
(#match? @_sigil_name "^(r|R)$")
(#match? @_sigil_name "^(R|r)$")
(#set! injection.language "regex")
(#set! injection.combined))
((sigil
(sigil_name) @_sigil_name
(quoted_content) @injection.content)
(#eq? @_sigil_name "H")
(#set! injection.language "heex")
(#set! injection.combined))
; Elixir Markdown Documentation
(unary_operator
operator: "@"
operand: (call
@ -23,3 +19,41 @@
(string (quoted_content) @injection.content)
(sigil (quoted_content) @injection.content)
])) (#set! injection.language "markdown"))
; Zigler Sigils
((sigil
(sigil_name) @_sigil_name
(quoted_content) @injection.content)
(#match? @_sigil_name "^(Z|z)$")
(#set! injection.language "zig")
(#set! injection.combined))
; Jason Sigils
((sigil
(sigil_name) @_sigil_name
(quoted_content) @injection.content)
(#match? @_sigil_name "^(J|j)$")
(#set! injection.language "json")
(#set! injection.combined))
; Phoenix Live View HEEx Sigils
((sigil
(sigil_name) @_sigil_name
(quoted_content) @injection.content)
(#eq? @_sigil_name "H")
(#set! injection.language "heex")
(#set! injection.combined))
; Phoenix Live View Component Macros
(call
(identifier) @_identifier
(arguments
(atom)+
(keywords (pair
((keyword) @_keyword (#eq? @_keyword "doc: "))
[
(string (quoted_content) @injection.content)
(sigil (quoted_content) @injection.content)
]))
(#match? @_identifier "^(attr|slot)$")
(#set! injection.language "markdown")))

@ -32,4 +32,4 @@
(do_block (_)* @test.inside)?)
(#match? @_keyword "^(test|describe)$")) @test.around
(comment) @comment.around @comment.inside
(comment)+ @comment.around @comment.inside

@ -3,6 +3,11 @@
((identifier) @constant
(#match? @constant "^[A-Z][A-Z_]*$"))
; class
(class_name_statement (name) @type)
(class_definition (name) @type)
; Function calls
(attribute_call (identifier) @function)

@ -0,0 +1,17 @@
(class_definition
(body) @class.inside) @class.around
(function_definition
(body) @function.inside) @function.around
(parameters
[
(identifier)
(typed_parameter)
(default_parameter)
(typed_default_parameter)
] @parameter.inside @parameter.around)
(comment) @comment.inside
(comment)+ @comment.around

@ -0,0 +1,28 @@
(section (identifier) @type.builtin)
(attribute (identifier) @attribute)
(property (path) @variable.other.member)
(constructor (identifier) @constructor)
(string) @string
(integer) @constant.numeric.integer
(float) @constant.numeric.float
(true) @constant.builtin.boolean
(false) @constant.builtin.boolean
[
"["
"]"
] @tag
[
"("
")"
"{"
"}"
] @punctuation.bracket
"=" @operator
(ERROR) @error

@ -0,0 +1,38 @@
["if" "then" "else"] @keyword.control.conditional
[
(local)
"function"
] @keyword
(comment) @comment
(string) @string
(number) @constant.numeric
[
(true)
(false)
] @constant.builtin.boolean
(binaryop) @operator
(unaryop) @operator
(param identifier: (id) @variable.parameter)
(bind function: (id) @function)
(fieldname (id) @variable.other.member)
[
"["
"]"
"{"
"}"
] @punctuation.bracket
"for" @keyword.control.repeat
"in" @keyword.operator
[(self) (dollar)] @variable.builtin
"assert" @keyword
(null) @constant.builtin
[
":"
"::"
";"
"="
] @punctuation.delimiter
(id) @variable

@ -1 +1,9 @@
[
(jsx_fragment)
(jsx_element)
(jsx_self_closing_element)
] @indent
(parenthesized_expression) @indent
; inherits: ecma

@ -1,16 +1,20 @@
(comment) @comment
"assert" @keyword.control.exception
"or" @keyword.operator
"rec" @keyword.control.repeat
[
"if"
"then"
"else"
] @keyword.control.conditional
[
"let"
"inherit"
"in"
"rec"
"with"
"assert"
"or"
] @keyword
((identifier) @variable.builtin
@ -42,14 +46,11 @@
(integer_expression) @constant.numeric.integer
(float_expression) @constant.numeric.float
(interpolation
"${" @punctuation.special
"}" @punctuation.special) @embedded
(escape_sequence) @constant.character.escape
(function_expression
universal: (identifier) @variable.parameter
"@"? @punctuation.delimiter
)
(formal
@ -57,11 +58,15 @@
"?"? @punctuation.delimiter)
(select_expression
attrpath: (attrpath (identifier)) @variable.other.member)
attrpath: (attrpath attr: (identifier)) @variable.other.member)
(interpolation
"${" @punctuation.special
"}" @punctuation.special) @embedded
(apply_expression
function: [
(variable_expression (identifier)) @function
(variable_expression name: (identifier) @function)
(select_expression
attrpath: (attrpath
attr: (identifier) @function .))])
@ -72,14 +77,18 @@
(binary_expression
operator: _ @operator)
(variable_expression (identifier) @variable)
(variable_expression name: (identifier) @variable)
(binding
attrpath: (attrpath (identifier)) @variable.other.member)
attrpath: (attrpath attr: (identifier)) @variable.other.member)
(identifier) @variable.other.member
(inherit_from attrs: (inherited_attrs attr: (identifier) @variable))
(inherit_from attrs: (inherited_attrs attr: (identifier) @variable.other.member) )
(has_attr_expression
expression: (_)
"?" @operator
attrpath: (attrpath
attr: (identifier) @variable.other.member))
[
";"

@ -0,0 +1,39 @@
; mark arbitary languages with a comment
((((comment) @injection.language) .
(indented_string_expression (string_fragment) @injection.content))
(#set! injection.combined))
((binding
attrpath: (attrpath (identifier) @_path)
expression: (indented_string_expression
(string_fragment) @injection.content))
(#match? @_path "(^\\w*Phase|(pre|post)\\w*|(.*\\.)?\\w*([sS]cript|[hH]ook)|(.*\\.)?startup)$")
(#set! injection.language "bash")
(#set! injection.combined))
((apply_expression
function: (apply_expression function: (_) @_func)
argument: (indented_string_expression (string_fragment) @injection.content))
(#match? @_func "(^|\\.)writeShellScript(Bin)?$")
(#set! injection.language "bash")
(#set! injection.combined))
(apply_expression
(apply_expression
function: (apply_expression
function: ((_) @_func)))
argument: (indented_string_expression (string_fragment) @injection.content)
(#match? @_func "(^|\\.)runCommand(((No)?(CC))?(Local)?)?$")
(#set! injection.language "bash")
(#set! injection.combined))
(apply_expression
function: ((_) @_func)
argument: (_ (_)* (_ (_)* (binding
attrpath: (attrpath (identifier) @_path)
expression: (indented_string_expression
(string_fragment) @injection.content))))
(#match? @_func "(^|\\.)writeShellApplication$")
(#match? @_path "^text$")
(#set! injection.language "bash")
(#set! injection.combined))

@ -258,6 +258,9 @@
; ---
(meta_item
(identifier) @function.macro)
(attr_item
(identifier) @function.macro
(token_tree (identifier) @function.macro)?)
(inner_attribute_item) @attribute

@ -0,0 +1,91 @@
; Highlights queries from Matthew Fluet (https://github.com/MatthewFluet/tree-sitter-sml)
;
; MIT License
;
; Copyright (c) 2022 Matthew Fluet
;
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to deal
; in the Software without restriction, including without limitation the rights
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
; copies of the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in all
; copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
; SOFTWARE.
;; *******************************************************************
;; Comments
;; *******************************************************************
[(block_comment) (line_comment)] @comment
;; *******************************************************************
;; Keywords
;; *******************************************************************
[
;; Reserved Words Core
"abstype" "and" "andalso" "as" "case" "datatype" "do" "else" "end"
"exception" "fn" "fun" "handle" "if" "in" "infix" "infixr" "let"
"local" "nonfix" "of" "op" "open" "orelse" "raise" "rec" "then"
"type" "val" "with" "withtype" "while"
;; Reserved Words Modules
"eqtype" "functor" "include" "sharing" "sig" "signature" "struct"
"structure" "where"
] @keyword
;; *******************************************************************
;; Constants
;; *******************************************************************
(integer_scon) @constant.numeric.integer
(real_scon) @constant.numeric.float
(word_scon) @constant.numeric
(string_scon) @string
(char_scon) @constant.character
;; *******************************************************************
;; Types
;; *******************************************************************
(fn_ty "->" @type)
(tuple_ty "*" @type)
(paren_ty ["(" ")"] @type)
(tyvar_ty (tyvar) @type)
(record_ty
["{" "," "}"] @type
(tyrow [(lab) ":"] @type)?
(ellipsis_tyrow ["..." ":"] @type)?)
(tycon_ty
(tyseq ["(" "," ")"] @type)?
(longtycon) @type)
;; *******************************************************************
;; Constructors
;; *******************************************************************
;; Assume value identifiers starting with capital letter are constructors
((vid) @constructor
(#match? @constructor "^[A-Z].*"))
((vid) @constant.builtin (#eq? @constant.builtin "nil"))
((vid) @constant.builtin.boolean
(#match? @constant.builtin.boolean "^(true|false)$"))
((vid) @operator (#eq? @operator "::"))
((vid) @keyword.storage.modifier (#eq? @keyword.storage.modifier "ref"))
;; *******************************************************************
;; Punctuation
;; *******************************************************************
["(" ")" "[" "]" "{" "}"] @punctuation.bracket
["." "," ":" ";" "|" "=>" ":>"] @punctuation.delimiter

@ -1,15 +1,16 @@
(comment) @comment
; identifiers
; -----------
(identifier) @variable
(yul_identifier) @variable
; Pragma
(pragma_directive) @tag
(solidity_version_comparison_operator ">=" @tag)
(solidity_version_comparison_operator "<=" @tag)
(solidity_version_comparison_operator "=" @tag)
(solidity_version_comparison_operator "~" @tag)
(solidity_version_comparison_operator "^" @tag)
(solidity_version_comparison_operator _ @tag)
; Literals
; --------
[
(string)
(hex_string_literal)
@ -26,26 +27,38 @@
(false)
] @constant.builtin
(comment) @comment
; Definitions and references
; -----------
; Type
(type_name) @type
(primitive_type) @type
(struct_declaration struct_name: (identifier) @type)
(enum_declaration enum_type_name: (identifier) @type)
(user_defined_type (identifier) @type)
; Color payable in payable address conversion as type and not as keyword
(payable_conversion_expression "payable" @type)
(emit_statement . (identifier) @type)
; Handles ContractA, ContractB in function foo() override(ContractA, contractB) {}
(override_specifier (identifier) @type)
; Ensures that delimiters in mapping( ... => .. ) are not colored like types
(type_name "(" @punctuation.bracket "=>" @punctuation.delimiter ")" @punctuation.bracket)
; Functions and parameters
; Definitions
(struct_declaration
name: (identifier) @type)
(enum_declaration
name: (identifier) @type)
(contract_declaration
name: (identifier) @type)
(library_declaration
name: (identifier) @type)
(interface_declaration
name: (identifier) @type)
(event_definition
name: (identifier) @type)
(function_definition
function_name: (identifier) @function)
name: (identifier) @function)
(modifier_definition
name: (identifier) @function)
(yul_evm_builtin) @function.builtin
@ -55,37 +68,38 @@
(fallback_receive_definition "receive" @constructor)
(fallback_receive_definition "fallback" @constructor)
(modifier_invocation (identifier) @function)
(struct_member name: (identifier) @variable.other.member)
(enum_value) @constant
; Handles expressions like structVariable.g();
(call_expression . (member_expression (property_identifier) @function.method))
; Invocations
(emit_statement . (identifier) @type)
(modifier_invocation (identifier) @function)
; Handles expressions like g();
(call_expression . (member_expression property: (identifier) @function.method))
(call_expression . (identifier) @function)
; Function parameters
(event_paramater name: (identifier) @variable.parameter) ; TODO fix spelling once fixed upstream
(function_definition
function_name: (identifier) @variable.parameter)
(call_struct_argument name: (identifier) @field)
(event_paramater name: (identifier) @variable.parameter)
(parameter name: (identifier) @variable.parameter)
; Yul functions
(yul_function_call function: (yul_identifier) @function)
; Yul function parameters
(yul_function_definition . (yul_identifier) @function (yul_identifier) @variable.parameter)
(meta_type_expression "type" @keyword)
(member_expression (property_identifier) @variable.other.member)
(property_identifier) @variable.other.member
(struct_expression ((identifier) @variable.other.member . ":"))
(enum_value) @variable.other.member
; Structs and members
(member_expression property: (identifier) @variable.other.member)
(struct_expression type: ((identifier) @type .))
(struct_field_assignment name: (identifier) @variable.other.member)
; Tokens
; -------
; Keywords
(meta_type_expression "type" @keyword)
[
"pragma"
"import"
"contract"
"interface"
"library"
@ -95,19 +109,6 @@
"event"
"using"
"assembly"
"switch"
"case"
"default"
"break"
"continue"
"if"
"else"
"for"
"while"
"do"
"try"
"catch"
"return"
"emit"
"public"
"internal"
@ -117,20 +118,47 @@
"view"
"payable"
"modifier"
"returns"
"memory"
"storage"
"calldata"
"function"
"var"
(constant)
"constant"
(virtual)
(override_specifier)
(yul_leave)
] @keyword
(import_directive "as" @keyword)
(import_directive "from" @keyword)
[
"for"
"while"
"do"
] @keyword.control.repeat
[
"break"
"continue"
"if"
"else"
"switch"
"case"
"default"
] @keyword.control.conditional
[
"try"
"catch"
] @keyword.control.exception
[
"return"
"returns"
] @keyword.control.return
"function" @keyword.function
"import" @keyword.control.import
(import_directive "as" @keyword.control.import)
(import_directive "from" @keyword.control.import)
(event_paramater "indexed" @keyword) ; TODO fix spelling once fixed upstream
; Punctuation
@ -142,7 +170,7 @@
"]"
"{"
"}"
] @punctuation.bracket
] @punctuation.bracket
[
@ -185,5 +213,7 @@
"--"
] @operator
(identifier) @variable
(yul_identifier) @variable
[
"delete"
"new"
] @keyword.operator

@ -0,0 +1,9 @@
(function_definition) @local.scope
(block_statement) @local.scope
(function_definition (parameter name: (identifier) @local.definition))
; still have to support tuple assignments
(assignment_expression left: (identifier) @local.definition)
(identifier) @local.reference

@ -1 +1 @@
; inherits: typescript
; inherits: typescript,jsx

@ -0,0 +1,91 @@
# Author : Nick Ogden <nick@nickogden.org>
"ui.background" = { bg = "grey01" }
"ui.menu" = { fg = "grey05", bg = "grey00" }
"ui.menu.selected" = { fg = "grey01", bg = "grey04" }
"ui.linenr" = { fg = "grey03", bg = "grey01" }
"ui.linenr.selected" = { fg = "grey04", bg = "grey01", modifiers = ["bold"] }
"ui.gutter" = { bg = "grey01" }
"ui.popup" = { fg = "grey05", bg = "grey00" }
"ui.window" = { bg = "grey01" }
"ui.selection" = { bg = "grey03" }
"ui.statusline" = { fg = "grey04", bg = "grey02" }
"ui.statusline.insert" = { bg = "white", fg = "grey01" }
"ui.statusline.select" = { bg = "orange", fg = "grey01" }
"ui.help" = { fg = "grey04", bg = "grey01" }
"ui.cursor" = { fg = "grey04", modifiers = ["reversed"] }
"ui.cursor.primary" = { fg = "grey05", modifiers = ["reversed"] }
"ui.cursor.match" = { fg = "white", modifiers = ["underlined"] }
"ui.cursorline.primary" = { bg = "grey02" }
"ui.cursorline.secondary" = { bg = "grey02" }
"ui.text" = "white"
"ui.text.focus" = "grey05"
"ui.virtual.ruler" = { bg = "grey02" }
"ui.virtual.indent-guide" = "grey02"
"ui.virtual.whitespace" = "grey03"
"operator" = "grey05"
"variable" = "white"
"variable.other.member" = "yellow"
"constant" = "lightblue"
"constant.numeric" = "lightblue"
"constant.character.escape" = "white"
"attribute" = "yellow"
"type" = "orange"
"string" = "darkgreen"
"function" = "yellow"
"function.macro" = "green"
"constructor" = "yellow"
"special" = "green"
"keyword" = "orange"
"comment" = { fg = "grey", modifiers = ["italic"] }
"label" = "purple"
"namespace" = { fg = "purple", modifiers = ["italic"] }
# HTML
"tag" = "orange"
"markup.heading.1" = "orange"
"markup.heading.2" = "yellow"
"markup.heading.3" = "darkred"
"markup.heading.4" = "grey"
"markup.heading.5" = "purple"
"markup.heading.6" = "darkgreen"
"markup.list" = "white"
"markup.bold" = { fg = "white", modifiers = ["bold"] }
"markup.italic" = { fg = "white", modifiers = ["italic"] }
"markup.link.url" = { fg = "lightblue", modifiers = ["underlined"] }
"markup.link.text" = "white"
"markup.quote" = "darkgreen"
"markup.raw" = "white"
"diff.plus" = "green"
"diff.delta" = "grey"
"diff.minus" = "red"
"diagnostic" = { modifiers = ["underlined"] }
"info" = "grey05"
"hint" = "grey05"
"debug" = "grey05"
"warning" = "orange"
"error" = "red"
[palette]
grey00 = "#181818" # Default Background
grey01 = "#282828" # Lighter Background (Used for status bars, line number and folding marks)
grey02 = "#383838" # Selection Background
grey03 = "#585858" # Comments, Invisibles, Line Highlighting
grey04 = "#b8b8b8" # Dark Foreground (Used for status bars)
grey05 = "#d8d8d8" # Default Foreground, Caret, Delimiters, Operators
grey06 = "#e8e8e8" # Light Foreground (Not often used)
grey07 = "#f8f8f8" # Light Background (Not often used)
white = "#d0d0d0"
yellow = "#eedd82"
orange = "#cc7832"
darkred = "#a34a27"
purple = "#9876aa"
green = "#32cd32"
grey = "#808080"
darkgreen = "#629755"
lightblue = "#6897bb"

@ -1,30 +1,30 @@
# Author: Alexander Brevig <alexanderbrevig@gmail.com>
# Author: Alexander Brevig <alexanderbrevig@gmail.com>, krfl <kr.fl@outlook.com>
# Adopted from https://github.com/biletskyy/flatwhite-syntax
"attribute" = { fg = "blue_text", bg = "blue_bg" }
"comment" = { fg = "base3", bg = "base7", modifiers = ["italic"] }
"comment" = { fg = "base3", modifiers = ["italic"] }
"comment.line" = {}
"comment.block" = {}
"comment.block.documentation" = { fg = "base2" }
"constant" = { fg = "blue_text", bg = "blue_bg" }
"constructor" = { fg = "base1", bg = "base7" }
"function" = { fg = "base1", bg = "base7", modifiers = ["bold"] }
"constructor" = { fg = "base1" }
"function" = { fg = "base1", modifiers = ["bold"] }
"keyword" = { fg = "purple_text", bg = "purple_bg" }
"label" = { modifiers = ["bold"] }
"namespace" = { fg = "teal_text", bg = "teal_bg" }
"operator" = { fg = "base1", bg = "base7" }
"operator" = { fg = "base1" }
"punctuation.bracket" = { modifiers = ["bold"] }
"special" = { fg = "blue_text", bg = "blue_bg" }
"string" = { fg = "green_text", bg = "green_bg" }
"type" = { fg = "base1", bg = "base7" }
"variable" = { fg = "base1", bg = "base7" }
"type" = { fg = "base1" }
"variable" = { fg = "base1" }
"variable.parameter" = { fg = "blue_text", bg = "blue_bg" }
"diagnostic" = { modifiers = ["underlined"] }
"info" = { fg = "orange_text", bg = "orange_bg" }
"hint" = { modifiers = ["bold"] }
"warning" = { fg = "orange_text", bg = "orange_bg" }
"error" = { fg = "diff_delete", bg = "base7" }
"error" = { fg = "diff_delete" }
"markup.heading" = { fg = "purple_text", bg = "purple_bg", modifiers = [
"bold",
@ -47,11 +47,12 @@
"ui.cursor" = { fg = "base1", bg = "base7", modifiers = ["reversed"] }
"ui.cursor.primary" = { fg = "base1", bg = "base7", modifiers = ["reversed"] }
"ui.cursor.match" = { fg = "base5", bg = "base3", modifiers = ["reversed"] }
"ui.selection" = { bg = "base3" }
"ui.selection.primary" = { fg = "base5", bg = "base3" }
"ui.selection" = { bg = "base4" }
"ui.selection.primary" = { fg = "base6", bg = "base2" }
"ui.virtual" = { bg = "base6" }
"ui.virtual.whitespace" = { bg = "base7" }
"ui.virtual" = { fg = "base5", bg = "base6" }
"ui.virtual.whitespace" = { fg = "base5" }
"ui.virtual.ruler" = { bg = "base6" }
"ui.linenr" = { bg = "base6" }
"ui.linenr.selected" = { bg = "base6", modifiers = ["reversed"] }
@ -66,15 +67,15 @@
"bold",
] }
"ui.text" = { fg = "base1", bg = "base7" }
"ui.text.focus" = { fg = "base1", bg = "base6", modifiers = ["bold"] }
"ui.text" = { fg = "base1" }
"ui.text.focus" = { fg = "base1", modifiers = ["bold"] }
"ui.menu" = { fg = "base1", bg = "base6" }
"ui.menu.selected" = { fg = "base1", bg = "base6", modifiers = ["reversed"] }
"ui.menu.scroll" = { fg = "base1", bg = "base6" }
"ui.help" = { fg = "base1", bg = "base7" }
"ui.popup" = { fg = "base1", bg = "base7" }
"ui.window" = { fg = "base1", bg = "base7" }
"ui.help" = { fg = "base1", bg = "base6" }
"ui.popup" = { fg = "base1", bg = "base6" }
"ui.window" = { fg = "base1", bg = "base6" }
"diff.plus" = { bg = "diff_add" }
"diff.delta" = { bg = "diff_change" }

@ -64,11 +64,12 @@
"ui.window" = { fg = "dark", bg = "darkest" }
"ui.help" = { fg = "light", bg = "dark" }
"ui.text" = { fg = "light" } # .focus / .info
# "ui.virtual" = {} # .ruler / .whitespace
"ui.virtual" = { fg = "dark" } # .ruler / .whitespace
"ui.virtual.ruler" = { bg = "darker"}
"ui.menu" = { fg = "light", bg = "dark" } # .selected
"ui.menu.selected" = { fg = "lightest", bg = "blue_accent" } # .selected
"ui.selection" = { bg = "select" } # .primary
"ui.selection" = { bg = "darker" } # .primary
"ui.selection.primary" = { bg = "select" } # .primary
"hint" = { fg = "blue_accent"}
"info" = { fg = "yellow_accent" }
"warning" = { fg = "orange_accent" }

@ -6,7 +6,7 @@
"ui.text.focus" = { fg = "yellow", modifiers= ["bold"] }
"ui.menu" = { fg = "base8", bg = "base3" }
"ui.menu.selected" = { fg = "base2", bg = "yellow" }
"ui.virtual.whitespace" = "base5"
"ui.virtual.whitespace" = "base4"
"ui.virtual.ruler" = { bg = "base1" }
"info" = "base8"

@ -1,11 +1,10 @@
# Author : RayGervais<raygervais@hotmail.ca>
"ui.linenr.selected" = { fg = "nord4" }
"ui.linenr.selected" = "nord4"
"ui.cursorline.primary" = { bg = "nord1" }
"ui.text.focus" = { fg = "nord8", modifiers= ["bold"] }
"ui.menu" = { fg = "nord6", bg = "#232d38" }
"ui.text.focus" = { fg = "nord8", modifiers = ["bold"] }
"ui.menu" = { fg = "nord6", bg = "nord1" }
"ui.menu.selected" = { fg = "nord8", bg = "nord2" }
"ui.virtual.whitespace" = "gray"
"ui.virtual.ruler" = { bg = "nord1" }
"info" = "nord8"
@ -14,33 +13,33 @@
# Polar Night
# nord0 - background color
"ui.background" = { bg = "nord0" }
"ui.statusline.inactive" = { fg = "nord8", bg = "nord1" }
"ui.statusline.inactive" = { fg = "nord8", bg = "nord1" }
"ui.statusline.normal" = { fg = "nord0", bg = "nord8" }
"ui.statusline.insert" = { fg = "nord0", bg = "nord13" }
"ui.statusline.select" = { fg = "nord0", bg = "nord15" }
# nord1 - status bars, panels, modals, autocompletion
"ui.statusline" = { fg = "nord4", bg = "#4c566a" }
"ui.popup" = { bg = "#232d38" }
"ui.window" = { bg = "#232d38" }
"ui.help" = { bg = "#232d38", fg = "nord4" }
"ui.statusline" = { fg = "nord4", bg = "nord1" }
"ui.popup" = { bg = "nord1" }
"ui.window" = { bg = "nord1" }
"ui.help" = { bg = "nord1", fg = "nord4" }
# nord2 - active line, highlighting
"ui.selection" = { bg = "nord2" }
"ui.cursor.match" = { bg = "nord2" }
# nord3 - comments, nord3 based lighter color
# relative: https://github.com/arcticicestudio/nord/issues/94
"comment" = { fg = "gray", modifiers = ["italic"] }
"ui.linenr" = { fg = "gray" }
# nord3 - comments, invisible/non-printable characters
"comment" = { fg = "nord3_bright", modifiers = ["italic"] }
"ui.linenr" = "nord3_bright"
"ui.virtual.whitespace" = "nord3_bright"
# Snow Storm
# nord4 - cursor, variables, constants, attributes, fields
"ui.cursor.primary" = { fg = "nord4", modifiers = ["reversed"] }
"attribute" = "nord4"
"variable" = "nord4"
"constant" = "nord4"
"variable" = "nord4"
"constant" = "nord4"
"variable.builtin" = "nord4"
"constant.builtin" = "nord4"
"namespace" = "nord4"
@ -48,28 +47,28 @@
# nord5 - subtle UI text
# nord6 - base text, punctuation
"ui.text" = { fg = "nord6" }
"ui.text" = "nord6"
"punctuation" = "nord6"
# Frost
# nord7 - classes, types, primitives
"type" = "nord7"
"type.builtin" = { fg = "nord7"}
"type.builtin" = "nord7"
"label" = "nord7"
# nord8 - declaration, methods, routines
"constructor" = "nord8"
"function" = "nord8"
"function.macro" = { fg = "nord8" }
"function.builtin" = { fg = "nord8" }
"function.macro" = "nord8"
"function.builtin" = "nord8"
# nord9 - operator, tags, units, punctuations
"punctuation.delimiter" = "nord9"
"operator" = { fg = "nord9" }
"operator" = "nord9"
"variable.other.member" = "nord9"
# nord10 - keywords, special
"keyword" = { fg = "nord10" }
"keyword" = "nord10"
"keyword.directive" = "nord10"
"variable.parameter" = "nord10"
@ -83,7 +82,7 @@
# nord13 - warnings, escape characters, regex
"warning" = "nord13"
"constant.character.escape" = { fg = "nord13" }
"constant.character.escape" = "nord13"
# nord14 - strings
"string" = "nord14"
@ -91,15 +90,13 @@
# nord15 - integer, floating point
"constant.numeric" = "nord15"
# TODO markup
"markup.heading" = "blue"
"markup.list" = "red"
"markup.bold" = { fg = "yellow", modifiers = ["bold"] }
"markup.italic" = { fg = "magenta", modifiers = ["italic"] }
"markup.link.url" = { fg = "yellow", modifiers = ["underlined"] }
"markup.link.text" = "red"
"markup.quote" = "cyan"
"markup.raw" = "green"
# markup
"markup.heading" = "nord8"
"markup.list" = "nord9"
"markup.bold" = { modifiers = ["bold"] }
"markup.italic" = { modifiers = ["italic"] }
"markup.link.text" = "nord8"
"markup.raw" = "nord7"
# vcs
"diff.plus" = "nord14"
@ -116,6 +113,9 @@
nord0 = "#2e3440"
nord1 = "#3b4252"
nord2 = "#434c5e"
# we use a brighter nord3 based on discussion here:
# https://github.com/arcticicestudio/nord/issues/94
nord3_bright = "#616e88"
nord4 = "#d8dee9"
nord6 = "#eceff4"
nord7 = "#8fbcbb"
@ -127,4 +127,3 @@ nord12 = "#d08770"
nord13 = "#ebcb8b"
nord14 = "#a3be8c"
nord15 = "#b48ead"
gray = "#616e88"

@ -0,0 +1,118 @@
# Palette based on https://github.com/NLKNguyen/papercolor-theme
# Author: Soc Virnyl Estela <socvirnyl.estela@gmail.com>
"ui.linenr.selected" = { fg = "linenr_fg_selected" }
"ui.background" = {bg="background"}
"ui.text" = "foreground"
"ui.text.focus" = { fg = "selection_background", modifiers = ["bold"]}
"ui.selection" = {bg="selection_background", fg="selection_foreground"}
"ui.cursorline" = {bg="cursorline_background"}
"ui.statusline" = {bg="paper_bar_bg", fg="regular0"}
"ui.statusline.select" = {bg="background", fg="bright7"}
"ui.statusline.normal" = {bg="background", fg="bright3"}
"ui.statusline.inactive" = {bg="background", fg="bright0"}
"ui.virtual.whitespace" = { fg = "regular5" }
"ui.virtual.ruler" = {bg="cursorline_background"}
"ui.cursor.match" = {bg = "regular5", fg = "regular0"}
"ui.cursor" = {bg = "regular5", fg = "background"}
"ui.window" = {bg = "#303030", fg = "bright2"}
"ui.help" = {bg = "background", fg = "bright2"}
"ui.popup" = {bg = "#303030", fg = "bright6"}
"ui.menu" = {bg = "#303030", fg = "bright6"}
"ui.menu.selected" = {bg = "#C6C6C6", fg="selection_foreground"}
"markup.heading" = { fg = "regular4", modifiers = ["bold"] }
"markup.heading.1" = { fg = "bright2", modifiers = ["bold"] }
"markup.heading.2" = { fg = "bright5", modifiers = ["bold"] }
"markup.heading.3" = { fg = "bright3", modifiers = ["bold"] }
"markup.heading.4" = { fg = "bright5", modifiers = ["bold"] }
"markup.heading.5" = { fg = "bright5", modifiers = ["bold"] }
"markup.heading.6" = { fg = "bright5", modifiers = ["bold"] }
"markup.list" = "bright3"
"markup.bold" = { fg = "foreground", modifiers = ["bold"] }
"markup.italic" = { fg = "bright0", modifiers = ["italic"] }
"markup.link.url" = { fg = "bright6", modifiers = ["underlined"] }
"markup.link.text" = "bright2"
"markup.link.label" = { fg = "regular2", modifiers = ["bold"] }
"markup.raw" = "foreground"
"string" = "foreground"
"attribute" = "bright7"
"keyword" = { fg = "regular4", modifiers = ["bold"]}
"keyword.directive" = "regular4"
"keyword.control.conditional" = "bright3"
"keyword.function" = "regular4"
"namespace" = "bright1"
"type" = "bright2"
"type.builtin" = { fg = "foreground", modifiers = ["bold"]}
"variable" = "foreground"
"variable.builtin" = "cyan"
"variable.other.member" = "cyan"
"variable.parameter" = "foreground"
"special" = "#3E999F"
"function" = "bright6"
"constructor" = "regular4"
"function.builtin" = { fg = "foreground", modifiers = ["bold"]}
"function.macro" = { fg = "regular4", modifiers = ["bold"] }
"comment" = { fg = "#686868", modifiers = ["dim"] }
"ui.linenr" = { fg = "bright0" }
"module" = "regular4"
"constant" = "bright5"
"constant.builtin" = "bright6"
"constant.numeric" = "bright5"
"constant.character.escape" = { fg = "foreground", modifiers = ["bold"]}
"operator" = { fg = "regular4", modifiers = ["bold"]}
"label" = { fg = "selection_background", modifiers = ["bold", "italic"] }
"diff.plus" = "regular2"
"diff.delta" = "regular6"
"diff.minus" = "regular1"
"warning" = "bright4"
"error" = "regular1"
"info" = "bright4"
diagnostic = { modifiers = ["bold", "underlined"]}
[palette]
background="#1c1c1c"
foreground="#d0d0d0"
regular0="#1c1c1c"
regular1="#af005f"
regular2="#5faf00"
regular3="#d7af5f"
regular4="#5fafd7"
regular5="#808080"
regular6="#d7875f"
regular7="#d0d0d0"
bright0="#585858"
bright1="#5faf5f"
bright2="#afd700"
bright3="#af87d7"
bright4="#FFAF00"
bright5="#ff5faf"
bright6="#00afaf"
bright7="#5f8787"
selection_foreground="#585858"
selection_background="#8787AF"
cursorline_background="#d0d0d0"
paper_bar_bg="#5F8787"
black="#1c1c1c"
red="#af005f"
green="#5faf00"
yellow="#d7af5f"
blue="#5fafd7"
magenta="#808080"
cyan="#d7875f"
gray="#d0d0d0"
light-red="#5faf5f"
light-green="#afd700"
light-yellow="#af87d7"
light-blue="#FFAF00"
light-magenta="#ff5faf"
light-cyan="#00afaf"
light-gray="#5f8787"
white="#808080"
linenr_fg_selected="#FFFF00"

@ -0,0 +1,135 @@
# Author : Rohit K Viswanath <kvrohit@gmail.com>
# Ported from : [rsms/sublime-theme](https://github.com/rsms/sublime-theme)
"attribute" = "cyan"
"keyword" = "blue"
"keyword.control.conditional" = { fg = "blue", modifiers = ["italic"] }
"keyword.directive" = "magenta" # -- preprocessor comments (#if in C)
"namespace" = { fg = "blue", modifiers = ["italic"] }
"punctuation" = "gray06"
"punctuation.delimiter" = "gray06"
"operator" = "yellow"
"special" = "yellow"
"variable" = "white"
"variable.builtin" = "bright_blue"
"variable.parameter" = "bright_white"
"variable.other.member" = "white"
"type" = "bright_white"
"type.builtin" = "magenta"
"type.enum.variant" = "magenta"
"constructor" = "yellow"
"function" = "white"
"function.macro" = "blue"
"function.builtin" = "blue"
"tag" = "yellow"
"comment" = { fg = "gray05", modifiers = ["italic"] }
"string" = "cyan"
"string.regexp" = "green"
"string.special" = "blue"
"constant" = "white"
"constant.builtin" = "white"
"constant.numeric" = "magenta"
"constant.character.escape" = "magenta"
# used for lifetimes
"label" = "yellow"
"markup.heading.marker" = { fg = "gray07" }
"markup.heading.1" = { fg = "white", modifiers = ["bold"] }
"markup.heading.2" = { fg = "gray07", modifiers = ["bold"] }
"markup.heading.3" = { fg = "gray07", modifiers = ["bold"] }
"markup.heading.4" = { fg = "gray07", modifiers = ["bold"] }
"markup.heading.5" = { fg = "gray06", modifiers = ["bold"] }
"markup.heading.6" = { fg = "gray06", modifiers = ["bold"] }
"markup.list" = "gray07"
"markup.bold" = { modifiers = ["bold"] }
"markup.italic" = { modifiers = ["italic"] }
"markup.link.url" = { fg = "cyan", modifiers = ["underlined"] }
"markup.link.text" = "blue"
"markup.raw" = "yellow"
"diff.plus" = "bright_green"
"diff.minus" = "bright_red"
"diff.delta" = "bright_cyan"
"ui.background" = { bg = "bg" }
"ui.background.separator" = { fg = "fg" }
"ui.linenr" = { fg = "gray04" }
"ui.linenr.selected" = { fg = "gray07" }
"ui.statusline" = { fg = "gray07", bg = "gray02" }
"ui.statusline.inactive" = { fg = "gray05", bg = "gray01" }
"ui.statusline.normal" = { fg = "black", bg = "cyan", modifiers = ["bold"] }
"ui.statusline.insert" = { fg = "black", bg = "blue", modifiers = ["bold"] }
"ui.statusline.select" = { fg = "black", bg = "magenta", modifiers = ["bold"] }
"ui.popup" = { bg = "gray01" }
"ui.window" = { fg = "gray02" }
"ui.help" = { bg = "gray01", fg = "fg" }
"ui.text" = { fg = "fg" }
"ui.text.focus" = { fg = "white" }
"ui.virtual" = { fg = "gray03" }
"ui.virtual.indent-guide" = { fg = "gray04" }
"ui.selection" = { bg = "gray03" }
"ui.selection.primary" = { bg = "gray03" }
"ui.cursor" = { bg = "gray04" }
"ui.cursor.insert" = { bg = "white" }
"ui.cursor.match" = { fg = "bright_yellow" }
"ui.cursor.select" = { bg = "gray03" }
"ui.cursorline.primary" = { bg = "gray01" }
"ui.highlight" = { bg = "gray03" }
"ui.menu" = { fg = "white", bg = "gray01" }
"ui.menu.selected" = { fg = "fg", bg = "gray03" }
"ui.menu.scroll" = { fg = "white", bg = "gray01" }
diagnostic = { modifiers = ["underlined"] }
warning = "bright_yellow"
error = "bright_red"
info = "bright_blue"
hint = "bright_cyan"
[palette]
bg = "#1a1a19"
fg = "#d1d1d1"
black = "#333332"
red = "#ff968c"
green = "#61957f"
yellow = "#ffc591"
blue = "#8db4d4"
magenta = "#de9bc8"
cyan = "#7bb099"
white = "#d1d1d1"
bright_black = "#4c4c4b"
bright_red = "#ffafa5"
bright_green = "#7aae98"
bright_yellow = "#ffdeaa"
bright_blue = "#a6cded"
bright_magenta = "#f7b4e1"
bright_cyan = "#94c9b2"
bright_white = "#eaeaea"
gray01 = "#222221"
gray02 = "#2a2a29"
gray03 = "#323231"
gray04 = "#3a3a39"
gray05 = "#6a6a69"
gray06 = "#767675"
gray07 = "#b6b6b5"

@ -102,12 +102,12 @@ _________________________________________________________________
--> Th stce misg so.
This sentence is missing some text.
Note: If you want to move the cursor while in Insert mode,
you may use the arrow keys instead of exiting and
reentering Insert mode.
Note: The status bar will display your current mode.
Notice that when you type i, 'NOR' changes to 'INS'.
=================================================================
= 1.5 SAVING A FILE =
=================================================================
Loading…
Cancel
Save