A post-modern modal text editor.
Go to file
Michael Davis 3318953bf6
minor: Use more exact allocations in insert_newline
This is partially a style commit:

* Pull more bindings out the `change_by_selection` closure like the
  line-ending string and the comment tokens used for continuation.
* Prefer `Editor::config` to `Document`'s config.

The rest is changes to places where `insert_newline` may allocate.

The first is to move `new_text` out of the `change_by_selection`
closure, reusing it between iterations. This is not necessarily always
an improvement as we need to clone the text for the return type of the
closure. `SmartString`'s `From<String>` implementation reuses the
allocation when the string is too long to inline and drops it if it is
short enough to inline though which can be wasteful. `From<&String>`
clones the string's allocation only when it is too long to be inlined,
so we save on allocations for any `new_text` short enough to be inlined.

The rest is changes to `new_text.reserve_exact`. Previously calls to
this function in this block mixed up character and byte indexing by
treating the length of the line-ending as 1. `reserve_exact` takes a
number of bytes to reserve and that may be 2 when `line_ending` is a
CRLF. A call to `reserve_exact` is also added to the branch used when
continuing line comments.
2025-01-15 10:57:03 -05:00
.cargo Add hook/event system 2024-01-23 11:20:19 +09:00
.github pin to ubuntu-22.04 for releases (#12464) 2025-01-11 10:52:13 -06:00
book Add support for the Gren programming language (#12525) 2025-01-14 08:26:56 -06:00
contrib Add changelog notes for 25.01 (#12347) 2025-01-03 13:50:51 -06:00
docs release docs: Fix git push command for the release tag 2024-12-22 09:48:32 -05:00
helix-core Use a workspace dependency for bitflags 2025-01-13 18:26:31 -05:00
helix-dap build(deps): bump the rust-dependencies group with 6 updates (#11924) 2024-10-23 22:34:20 +09:00
helix-event Add support for path completion (#2608) 2024-11-21 21:12:36 -06:00
helix-loader build(deps): bump the rust-dependencies group with 3 updates (#12437) 2025-01-06 19:34:21 -05:00
helix-lsp build(deps): bump the rust-dependencies group with 6 updates 2025-01-13 23:09:54 +00:00
helix-lsp-types Use a workspace dependency for bitflags 2025-01-13 18:26:31 -05:00
helix-parsec fix(clippy): clippy 1.83 lints (#12150) 2024-12-02 08:23:32 -06:00
helix-stdx Use a workspace dependency for bitflags 2025-01-13 18:26:31 -05:00
helix-term minor: Use more exact allocations in insert_newline 2025-01-15 10:57:03 -05:00
helix-tui Use a workspace dependency for bitflags 2025-01-13 18:26:31 -05:00
helix-vcs build(deps): bump the rust-dependencies group with 3 updates (#12437) 2025-01-06 19:34:21 -05:00
helix-view Use a workspace dependency for bitflags 2025-01-13 18:26:31 -05:00
runtime Improve dark_plus theme: Change special, ui.text.directory and ui.virtual.wrap (#12530) 2025-01-14 12:55:01 -06:00
xtask minor: Setup default keymap directly in xtask docgen 2024-12-28 21:42:09 -05:00
.envrc direnv: Watch the rust-toolchain file (#8921) 2023-11-29 11:01:12 +09:00
.gitattributes Add .gitattributes (#3318) 2022-08-03 08:21:51 -05:00
.gitignore fix: added .DS_Store to gitignore 2024-11-20 16:18:42 -06:00
base16_theme.toml base16_default: add styles to newer unthemed features (#10858) 2024-06-23 10:07:13 +09:00
Cargo.lock build(deps): bump the rust-dependencies group with 6 updates 2025-01-13 23:09:54 +00:00
Cargo.toml Use a workspace dependency for bitflags 2025-01-13 18:26:31 -05:00
CHANGELOG.md changelog: Add missing breaking change for display-messages config 2025-01-06 14:18:26 -05:00
default.nix Expose all flake outputs through flake-compat (#10673) 2024-05-07 01:33:59 +09:00
flake.lock Bump flake dependencies 2024-10-21 11:27:46 +09:00
flake.nix Make git revision available for nix flake builds (#12331) 2024-12-25 11:26:53 -06:00
grammars.nix Make nix flake respect unused grammars (#9326) 2024-01-14 15:11:40 +01:00
languages.toml Add '///' to Dart comment-token configuration 2025-01-15 08:33:33 -05:00
LICENSE Add the LICENSE file. 2021-05-11 01:44:00 +09:00
logo_dark.svg Reduce logo sizes even more (#9211) 2024-01-02 23:16:37 +01:00
logo_light.svg Reduce logo sizes even more (#9211) 2024-01-02 23:16:37 +01:00
logo.svg Reduce logo sizes even more (#9211) 2024-01-02 23:16:37 +01:00
README.md Fix repology badge (#11895) 2024-10-16 01:52:50 +09:00
rust-toolchain.toml chore(msrv): bump MSRV from 1.70 to 1.76 2024-11-22 01:17:08 -08:00
rustfmt.toml Add rustfmt.toml to force formatting to use rustfmt defaults 2021-07-23 18:11:22 +09:00
screenshot.png update screenshot (#1879) 2022-03-30 00:16:57 +09:00
shell.nix build(nix): update flake deps, add default.nix file 2022-06-21 17:39:30 -05:00
theme.toml Allow theming directory prompt completions (#12205) 2024-12-17 21:13:42 -06:00

Helix

Build status GitHub Release Documentation GitHub contributors Matrix Space

Screenshot

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.

For more information, see the website or documentation.

All shortcuts/keymaps can be found in the documentation on the website.

Troubleshooting

Features

  • Vim-like modal editing
  • Multiple selections
  • Built-in language server support
  • Smart, incremental syntax highlighting and code editing via tree-sitter

Although it's primarily a terminal-based editor, I am interested in exploring a custom renderer (similar to Emacs) using wgpu or skulpin.

Note: Only certain languages have indentation definitions at the moment. Check runtime/queries/<lang>/ for indents.scm.

Installation

Installation documentation.

Packaging status

Contributing

Contributing guidelines can be found here.

Getting help

Your question might already be answered on the FAQ.

Discuss the project on the community Matrix Space (make sure to join #helix-editor:matrix.org if you're on a client that doesn't support Matrix Spaces yet).

Credits

Thanks to @jakenvac for designing the logo!