Skip to content

Instantly share code, notes, and snippets.

@cessen
Last active March 9, 2024 15:19
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cessen/c4c91c2e7eb5b0120fcb91c9b0ebe853 to your computer and use it in GitHub Desktop.
Save cessen/c4c91c2e7eb5b0120fcb91c9b0ebe853 to your computer and use it in GitHub Desktop.
Helix notes

My personal notes on using Helix

I've started using Helix as my main editor, and I wanted a place to jot down notes as I run into things. So this is that spot. For anyone stumbling on this, please keep in mind that over-all I'm really liking Helix, which isn't well reflected in the notes below.

Please, no comments here

Please don't add comments to this gist. I do want to discuss these items, but not here. This is just a place for my personal notes, to help me keep track of my thoughts. (Unfortunately, Github doesn't support disabling comments on gists.)

If you're reading this and want to comment on something, feel free to open up an issue on the Helix repo if it's significant enough, or just ping me in the Helix matrix room otherwise.

Minor annoyances

  • I indent/detent blocks of code relatively often. Having to use < and > (which involve holding down shift) to accomplish that is pretty annoying. I'd rather it just be on straight , and .. Or maybe the square brackets.
    • Be able to customize . as a hotkey.
  • What is the command for closing a buffer? I can't find it in the documentation, and the command prompt isn't auto-completing any of the things I can think of.
  • I wish hitting Esc while in normal mode collapsed all selections down to just the primary cursor. Space-space already does this, of course. But from a first-time-user perspective, Esc kind of operates as a general "get me out of the current abnormal situation" key, and I expect (multiple-) selections to fall under that category.
  • "Search previous" seems to be missing...? Or at least it's not listed in the documentation.
  • I wish there were alternative commands to w and friends that move the cursor by word without making selections. I find the selections really visually distracting.

Misc

  • Although tight language integration is cool, I'd rather have features that take the 80/20 approach: features that make Helix work with any language ~80% well, with just a minimal amount of effort from the user. For example, if I decide to play with a new language that's not well supported by any editors out there yet, it's nice to be able to specify a crappy regex-based syntax that can be picked up for both syntax highlighting and indexing (for e.g. jump-to-definition). Even if it doesn't work 100%, it's way better than nothing, and having the option to quickly knock that out as needed as a user is really powerful. Even for languages that otherwise have tight integration, having a fall-back like this if I don't want to e.g. boot up an LSP server is really nice. Note that I wouldn't want this to replace tight language integration--just be there as a fallback and supplement.
  • I wonder if we can make the keymap more new-user friendly (by which I mean people that haven't used e.g. vim or kak before), while still keeping it just as powerful and fast/ergonomic for power users. For example, using z/x/c/v for undo/cut/copy/paste instead of u/d/y/p. Ironically that ruins mneumonics, but in practice it would probably be more obvious for new users (basically the same keys they're used to, but without ctrl).
  • More generally, I'm curious what could be achieved if we just completely abandon the prior art of vim, kak, etc. and start from scratch. Maybe z/x/c/v is a bad idea (not so ergonomic, for example). But there are probably gains that can be made by starting from first principles, and considering e.g. what keys are fastest to access and what functions people use most often in practice.
  • Emacs has the ability to "undo within selection", which I think is really cool. Emacs can do this because of the way its undo stack works: undo operations themselves actually just get pushed onto the undo stack as well. But I think we can still make this work by pushing only "undo within selection" ops onto the undo stack, rather than general undo.
  • Maybe have an option to make the undo stack work like emacs? Dunno. It's weird, but it's also really powerful.
  • I wish there was an alternative to w that instead of jumping, just selected the word currently under the cursor. (Possibly selecting the next word only if the current word is already selected.)

Things I miss from Sublime Text

  • The ability to interactively move lines up/down in the file. The same thing can be accomplished by copy/paste, of course, but it's not as visual/interactive.
  • An indication in the gutter of what lines have been modified according to e.g. git (or whatever VCS).
  • Buffers automatically reloading from disk when the on-disk file is modified and the buffer isn't dirty. This is really nice when you're also modifying files from the command line (e.g. sed, cargo fmt, etc.). Basically, it makes the editor cooperate with other editing approaches.
  • An easy way to create multiple cursors vertically, extending either up or down from the primary cursor.
  • A hot key that extends the current selection in the following way: it finds the next text in the file that exactly matches the current selection, and adds that to the selection. I use this all the time for quickly renaming things: just select one instance of what I want to rename, press this hotkey as many times as needed, and then start editing. In Helix, we might accomplish this same functionality with a hot key that just sets the current search term to be the currently selected text (without actually starting the search). Then you just hit N as many times as needed. The * command almost does this, but it also immediately searches for the next occurrence of the selection, which makes it effectively useless for this use-case.
  • Tab to auto-complete from the current file's contents (no fancy language server needed).

Things I miss from Zed (no, not the recent commercial Zed)

I'm talking about the completely unrelated open source Zed that went defunct around 2015.

  • Auto-save.
  • Infinite, persistent undo.
  • The most-recently-accessed files being sorted to the top of the fuzzy-search file opener. It's such a simple thing, but it's really a workflow changer. It effectively puts your current "working set" of files at the top of the list so they're always easily accessible for fast switching.
  • Auto-closing buffers. In Zed, it only keeps the visible buffers open. But I think in Helix it would be better to have an optional (and off-by-default) feature to close the least-recently-used non-dirty buffer when the number of open buffers exceeds an user-specified threshhold.
  • The 80/20 language integration (as discussed in the Misc section above).

Things I miss from Led

  • How it handles soft line wrapping:
    • Using chunking so that super-long lines don't bog down the system.
    • Option to maintain (or even increase) indent on soft-wrapped lines. IMO this is an important feature, and it always surprises me when editors don't have it.
  • The way it displays line numbers in the gutter. In particular, how it uses background color to give a visual indication of where the hard line breaks are, so that out of the corner of your eye it's still obvious where the soft line wrapping is.

Things I miss from vim

  • Having the command prompt double as go-to-line when you enter a number. This can already be accomplished with typing the line number and then pressing g of course. But especially with longer line numbers, I like being able to see (and edit if I make a typo) the line number I'm entering.
    • We could even improve on this over vim by also allowing line:col syntax to jump to a specific column as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment