hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

9K
active users

#HelixEditor

7 posts5 participants0 posts today

Spent the last couple days learning #HelixEditor as a contrast to my #emacs maximalist tendencies.

I managed to crash it once so far, with an out of bound Rope slice, but otherwise I am impressed with how much I can do with it even without plug-ins or a scripting language.

I especially like the match mode and the tree-sitter based movement.

Continued thread

Remarkably built on all four platforms that I use: macOS, Kubuntu 24.04 both as base OS on a laptop I use at home and under WSL on my work laptop, and most surprisingly of all, it built on Git Bash for Windows!

No errors. No problems running.

I’ve built a lot of Open Source projects and I don’t think I’ve ever seen this before.

I am now building for myself, on master, as recommended by @clementd.

First, in my environment I set`export HELIX_RUNTIME="~/.config/helix/runtime"`. I then followed the build directions at docs.helix-editor.com/building. I fetched and built the grammars as described there.

Something **not** mentioned in those directions was that I had to copy from the source directory themes and queries into the runtime path I mentioned above. Maybe there are other things I need to copy that I haven’t noticed yet.

The binary ended up in ~/.cargo/bin/hx.

I don’t know if what I built is optimized.

docs.helix-editor.comBuilding from source

I’m really starting to love so much. It’s now my daily driver. It’s frustrating to me when it falls down. I’m going to make myself a list of those things I want that don’t work, what issues or discussions have been filed about them, and what work is being done on them.

I’m also going to start running nightlies (if that’s a thing) or my own builds.

It’s lovely how easy projects are to build. Thank you, .

How annoying: The released does not understand `trim-trailing-whitespace` or `trim-final-newlines` and their regular expression engine makes it difficult to do by hand. Yes, I’ve been reading the wrong docs; but also, I need these.

Might have start building it myself.

I have roughly 30 plugins in . covers the functionality of almost all of them. It doesn’t have the power of vim-abolish; and it’s maybe got a little ways to go on working with . Abolish seems too complicated and special case to fit into the core of Helix. I don’t use it often, but when that’s the tool you need, Abolish is the only thing that will do the job.

Continued thread

So it does look like the TypeScript language server has a limit of 4MB source size where it disables type checking (and actually shows an erroneous error stating that exports that exist in the file do not exist) for files that are imported but not open in the current workspace/session.

Still not sure if this is documented anywhere or not (haven’t been able to find it, if it is).

99.99999% of the time, unless you’re doing niche stuff like I am, you won’t run into this.

Workaround: should you have such a large file, e.g., with a large generated object, try and refactor to split it up into multiple files and rejoin it a separate file. The actual object size/memory usage isn’t the issue, it’s the file size.

github.com/typescript-language

I ran into an issue while creating and exporting a constant object that holds component versions of the ~1,500 icons in the Phorsphor icons library and I’ve created the simple reproduction below: D...
GitHubServer fails on import when exported object constant has too many entries/is too large · Issue #951 · typescript-language-server/typescript-language-serverBy aral
#TypeScript#max#lines

Been using full-time several days in a row now. Editing is getting easier. I’m remembering how to do things better and faster. I have three language servers installed now: , , and . I love seeing errors and warnings right in the editor. I love being able to run the formatter at will. I love being able to use tree-sitter nodes as textobjects. I still have some things that catch me every time. Like when your cursor is sitting on the end-of-line position in normal mode: the difference between 'a' and 'A'. And I’m still not used to going into insert mode while there is a selection growing the selection as you type.

I’m very far from a Helix expert, and I disagree about some things; but I really feel good about this editor.

#HelixEditor crashes by typing multi-byte chars into search box. This seems to fix it....

diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs
index 3c97a93c..94f9f775 100644
--- a/helix-term/src/ui/prompt.rs
+++ b/helix-term/src/ui/prompt.rs
@@ -551,6 +551,9 @@ pub fn render_prompt(&mut self, area: Rect, surface: &mut Surface, cx: &mut Cont
if self.truncate_end && self.cursor - self.anchor >= self.line_area.width as usize {
self.anchor += 1;
}
+ while !self.line.is_char_boundary(self.anchor) {
+ self.anchor += 1;
+ }

surface.set_string_anchored(
self.line_area.x,
@@ -734,7 +737,10 @@ fn cursor(&self, area: Rect, editor: &Editor) -> (Option<Position>, CursorKind)
.clip_left(self.prompt.len() as u16)
.clip_right(if self.prompt.is_empty() { 2 } else { 0 });

- let anchor = self.anchor.min(self.line.len().saturating_sub(1));
+ let mut anchor = self.anchor.min(self.line.len().saturating_sub(1));
+ while !self.line.is_char_boundary(anchor) {
+ anchor += 1;
+ }
let mut col = area.left() as usize
Replied in thread

@ainmosni @bernh In case you're thinking about giving Helix a try, make sure to start off with the tutorial (run it from the command line with the --tutor argument).

As for getting on top of the key bindings in Helix, I created a crib sheet to help me remember/find the most vital and most interesting controls:

bobulous.org.uk/coding/Helix-c

(Definitely best viewed on a big screen.)

www.bobulous.org.ukHelix crib sheetA quick reference for the key bindings and modes used in the multi-modal text editor Helix.
Replied in thread

@galdor I see your point, and idiom in agrees with you. Import such that at the call-site you say `module.identifier()`.

On the one side (the side that disagrees with you), my IDE typically tells me where naked `identifier` is defined (either or in my case); and it’s the most common case in code I have read (and I’ve been programming in Python for decades).

On the other side you’re not always hovering as you read over big blocks of code. Naming the origin module is informative.

In the middle, it’s not needed for a lot of things, especially stdlib and common packages. It seems like a fine line and I’m not quite certain what the best behavior is.

I’m liking more and more each day. I think it has a ways to go; and I’m not nearly as fast in Helix as I am in Vim (mostly because I keep stopping to look stuff up) but I see no reason, with _my_ workflow, not to use Helix as my daily driver. (This after more than 20 years as a and then user). The LSP and tree-sitter stuff are absolutely compelling.

If you are constantly SSHing into machines you don’t control; and that’s your whole job — you probably have a different answer.

Replied in thread

@art I’m a long time and user. In fact, I’ve given talks on them. I use Vim key-bindings everywhere I can; especially in . I’ve been using lately. The key-bindings come from Vim, but aren’t about playing code golf. They’re about being easy to use and remember. When you start a multi-key sequence, there is typically a menu that pops up showing you what the next key can be. The big difference, though, is that in Helix first you make a selection, and then you act on it.

Helix is easier to use than Vim/NeoVim. I’m just a Helix beginner especially compared to my skills in Vim. Helix is absolutely worth a try. If it’s Vim for you, then it’s Vim. But Helix might offer you something familiar but simpler.