Custom line editing
Related problem
Hi, I'd really like to be able to implement completely custom keybindings, in the same way as can be done using Zsh-Line-Editor in Zsh, which makes plugins such as https://github.com/jeffreytse/zsh-vi-mode possible. The only way I can see to implement this currently is to create custom keybindings with Reedline and then fork Nushell to use them. Is there an alternative solution I'm missing?
Describe the solution you'd like
A straightforward way to swap in custom keybindings
Describe alternatives you've considered
No response
Additional context and details
No response
Nushell supports custom keybindings as explained here on the reedline page. Does this meet your needs, and if not what specifically are you looking to be able to do that the current functionality doesn't provide?
Nushell supports custom keybindings as explained here on the reedline page. Does this meet your needs, and if not what specifically are you looking to be able to do that the current functionality doesn't provide?
I’m hoping to implement an entirely different way of navigating the buffer, using Helix-style keybindings, that will be completely independent from the built-in emacs or vi modes. Given this I don’t think the keybindings described in the docs will be suitable, unfortunately
I’ve just updated the title to “Custom line editing” as I guess this is what I really want, not just custom keybindings
Reedline is limited with its keybindings because, in vi mode, the default/internal mappings take precedence/override user mappings (which makes zero sense to me). That needs to be fixed imo. Also the vi mode isn't quite correct (w jumps overs periods, cursor goes past EOL in normal mode where hitting x gets stuck, 999dl delete chars on following lines, etc.), and might need to be fixed as well.
Transferred to reedline since it's the line editor that nushell uses.
Transferred to reedline since it's the line editor that nushell uses.
Thanks for this. I'd be happy to take a look at adding PRs to both reedline and nushell if there would be appetite to add this? Are there any objections?
No objections. I'd love to see our vim keybinding improved and functionality augmented with helix-style keybinds. The only thing I worry about is reviewing such a PR. If you take it on, it would be nice to make several PRs so they are reviewable. It's already very difficult to get people to review any PR in this repo much less large ones.
That makes sense, I’ll be sure to break any changes up in to manageable PRs - thanks!