helix icon indicating copy to clipboard operation
helix copied to clipboard

Add `unbind-default-keys` config option

Open Lindenk opened this issue 3 years ago • 2 comments

Closes #2720.

There were a few changes I made to reduce confusion with some function/method locations and naming:

  • helix_term::keymap::merge_keys was moved to helix_term::config::Config::merge_keys as a method because it only operates on and changes Config, and was modified to take a set of bindings to merge with itself. New functions were also added to handle the new optional behavior.
  • Config::load now is the single source of truth for loading and merging configs, which was previously also handled in helix_term::application::new in a slightly different but mostly redundant manner.
  • Default is removed from Config and replaced with Config::new and Config::with_default_keys. new returns a Config with no bindings while with_default_keys returns a Config with the default bindings (which is the same behavior as the old default). This to prevent confusion between a default rust struct and helix's default keybindings as these terms were previously conflated.
  • Config::keys no longer loads default bindings through serde when no keys are found as this was always redundant.
  • helix_term::keymap::Keymaps::get no longer crashes when a mode isn't found. This will also help with future mode additions (likely through plugins down the line).

Let me know if any of these changes should be handled differently

Lindenk avatar Jun 10 '22 04:06 Lindenk

Could you add some notes on using this to the docs? https://github.com/helix-editor/helix/tree/f37ffaa3a1c7754238029390db00148ec8105874/book/src

the-mikedavis avatar Jun 10 '22 16:06 the-mikedavis

No problem. If you'd like me to include a new subsection or larger blurb, or if there's a better place to provide this specific documentation, let me know

Lindenk avatar Jun 10 '22 16:06 Lindenk

Is there any movement on this? I'd really like to try out this feature.

patrick-kidger avatar Nov 10 '22 17:11 patrick-kidger

I updated the feature to the current version of helix and addressed the above changes. Now it only adds the config option unbind_default_keys

Lindenk avatar May 04 '23 01:05 Lindenk

https://github.com/helix-editor/helix/pull/9384#issuecomment-2065534491, https://github.com/helix-editor/helix/issues/2720#issuecomment-2065533370 - we want to solve this when we switch config away from TOML rather than adding a new config option now

the-mikedavis avatar Apr 19 '24 00:04 the-mikedavis