Live data from Hacker News

Notes on switching to Helix from Vim

jvns.ca

201–210 of 242 posts

Re: Notes on switching to Helix from Vim

#201

Helix still has no way to emulate Sublime's Ctrl + Click (placing multiple carets), nor Sublime's Ctrl + D (duplicating selections and creating a multiple caret for each)?

Cmd + click places multiple carets on macOS. Apparently – I never touch the mouse when I’m editing in Helix. I don’t know which modifier it is on other platforms. I’m not sure if replicating Sublime’s Ctrl + D is possible or not, but there are other ways to achieve every use case for it I can immediately think of. e.g. I think I’d typically be doing ` h` to select every instance of the symbol under the cursor, or usi…

Does not work on Linux. Also, double-clicking to expand selection like in Sublime does not work.

https://github.com/helix-editor/helix/discussions/10208

Re: Notes on switching to Helix from Vim

#202
post #98

I've been trying Helix and really like it. But as someone coming from VS Code, I've been relying a lot on VS Code automatically saving and restoring sessions on restart (things like opened files, unsaved files, cursor position, etc.). It's helpful when I occasionally restart my computer. How do you that in Helix (or for that matter in Neovim)?

I don't know about Helix but Neovim (and vim) has something called sessions and it does everything but unsaved files. By default it's manual but it wouldn't be too difficult to automate. A very simple way could just create/update the session on BufWritePost and ExitPre. Then create an alias to open Neovim with that session: 'nvim -S .session.vim'.

You'll get an error if the session doesn't exist but it's easy to dismiss. There are probably plugins that do this in a more seamless way though if you prefer.

Re: Notes on switching to Helix from Vim

#203

Earlier quoted context omitted.

Fair enough, I definitely made some assumptions there, but it sure sounds the same based on the description. I guess `%` selects more than just the token? But ya, I'm way too invested in Vim to bother with Helix. I have years of scripts and plugins I've written. I can't even be bothered to switch to nvim (I tried once and was not fun).

“%” is a range operator standing for the entire buffer; so :%s just means to start a substitution on the whole buffer. Neovim will highlight what was previously searched for, in this case matched by the *, but that won’t actually affect the search command. The way :s works in Neovim looks like multiple cursors to me, but I’m not familiar enough with Helix to know what the difference is.

Also :s without a range is not going to work like multiple cursor as it only acts on the current line, unless neovim has changed this for some reason. But again, I was assuming //g was a given.

Re: Notes on switching to Helix from Vim

#204
post #106

Earlier quoted context omitted.

> I don't get it, there is always a choice to make, which is which action to continue with? The point is that if the input for a command is XY, there had better also be an XZ. Otherwise XY should just be X.

How is this relevant to the tooltip conversation? If you have XY (without XZ) instead of just X, well, maybe you could simplify, or maybe it still makes sense for you for some reason, whatever, in any case you'd appreciate immediate contextual help if you press X and then forget that Y is the finisher.

Because if the command is just X then you just input X and the action occurs. There is no need for "immediate contextual help" because there is no time wasted on a useless immediate context.

It's bad UI design to have the user input X and then wait for Y before doing anything when there is only one intention the user could actually have in mind. Having a popup say in effect "hey, I'm not going to do anything until you press Y" is not an improvement.

Re: Notes on switching to Helix from Vim

#205
post #80

I tried to switch from neovim to helix for a couple weeks, but noted down the following things that were essential to me and not implemented yet: - Code actions on save, for example adding Go imports: https://github.com/helix-editor/helix/pull/6486 - Fuzzy search with a filepicker like telescope+rg, seems to have been added earlier this year: https://github.com/helix-editor/helix/pull/11285 - Automatically updating b…

I have the same issue with Helix not watching and reloading modified files automatically, as I sometimes run external programs modifying those files (templ and sqlc are good examples). Curious about how experienced Helix users are addressing this.

I have file reload binded to key:

    [keys.normal.space.f]
    f = "file_picker_in_current_directory"
    F = "file_picker"
    b = "file_picker_in_current_buffer_directory"
    "." = ":toggle-option file-picker.git-ignore"
    g = "global_search"
    e = "file_explorer"
    r = ":reload-all"
    x = ":reset-diff-change"
    w = ":echo %sh{git blame -L %{cursor_line},+1 %{buffer_name}}"

Re: Notes on switching to Helix from Vim

#206
post #106

Earlier quoted context omitted.

How is this relevant to the tooltip conversation? If you have XY (without XZ) instead of just X, well, maybe you could simplify, or maybe it still makes sense for you for some reason, whatever, in any case you'd appreciate immediate contextual help if you press X and then forget that Y is the finisher.

Because if the command is just X then you just input X and the action occurs . There is no need for "immediate contextual help" because there is no time wasted on a useless immediate context. It's bad UI design to have the user input X and then wait for Y before doing anything when there is only one intention the user could actually have in mind. Having a popup say in effect "hey, I'm not going to do anything until y…

> input X and then wait for Y before doing anything when there is only one intention the user could actually have in mind

That's obviously false, the second possible intention is... cancellation. For example, you can bind Q,Q to quit the app (and no other key is prefixed with a Q), but then you could press Q mistakenly or change your mind at the last moment.

But you continue to argue with your own strawman - nothing about helpful popups changes the underlying behavior. So if your magic design is to run XY just on X press, that would be bad design, but you can still do it! And the popup will never appear because the action is complete, so no help needed.

Re: Notes on switching to Helix from Vim

#207
post #190

Earlier quoted context omitted.

I have not seen any unergonomic defaults in vim. Check your understanding of vim philosophy probably.

Check your understanding of ergonomics if you fail to see the obvious

Can you give at least a few examples? I have no understanding of ergonomics it seems

Re: Notes on switching to Helix from Vim

#209

Earlier quoted context omitted.

in kakoune, this is ` p |reflow `. which is obviously not as simple as `gq`, but you can rebind this, add things like auto-reflow as you type, etc., rather trivially, and rebind them (and a lot of these types of tools come preloaded as bindable commands). it's some work to set up this type of thing (and it makes perfect sense to use e.g. vim to not need to do that), but i like the composable design, where i can write…

> i can write some configuration to hook a shell command to a bind is `reflow` a binary that comes with kakoune or something?

apologies, i probably should've written `fmt` there (which does the same thing). `reflow` is a `fmt` clone i wrote, without the knowledge `fmt` existed --- that was a bit embarrassing for a friend to eventually point out, that my idea was already in coreutils :D i use `fmt` now because i figure it's far better tested (i think it's posix), but i still think of the action as a "reflow", and that's also the term helix uses.

Re: Notes on switching to Helix from Vim

#210
I recently got into neovim and some things that the author mentions can be found in pre-built configurations like kickstart by default. E.g when hitting "g" I also get a popup with the available follow up keys alongside the final keybind's result. Grepping text provides a preview window with the context of the line that was found
Post reply on HN