From cd3dc9c1a297fb4d1ad97906e4d40165a4c9deee Mon Sep 17 00:00:00 2001 From: Linden Krouse Date: Fri, 10 Jun 2022 12:48:58 -0400 Subject: [PATCH] Renamed config option to `unbind-default-keys` --- book/src/remapping.md | 2 +- helix-term/src/config.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/book/src/remapping.md b/book/src/remapping.md index eba64e0b8cc47..e69f5b0098e78 100644 --- a/book/src/remapping.md +++ b/book/src/remapping.md @@ -51,7 +51,7 @@ Control, Shift and Alt modifiers are encoded respectively with the prefixes Individual keys can be disabled by binding them to the `no_op` command. -To remove the default bindings for all modes defined by the user, `unbind_defaults = true` can be added to the top level configuration. +To remove the default bindings for all modes defined by the user, `unbind-default-keys = true` can be added to the top level configuration. Commands can be found at [Keymap](https://docs.helix-editor.com/keymap.html) Commands. diff --git a/helix-term/src/config.rs b/helix-term/src/config.rs index b5135a5fe5eeb..c490b0ddc98fa 100644 --- a/helix-term/src/config.rs +++ b/helix-term/src/config.rs @@ -12,7 +12,7 @@ use toml::de::Error as TomlError; pub struct Config { pub theme: Option, #[serde(default)] - pub unbind_defaults: bool, + pub unbind_default_keys: bool, #[serde(default)] pub keys: HashMap, #[serde(default)] @@ -40,7 +40,7 @@ impl Config { pub fn new() -> Self { Config { theme: None, - unbind_defaults: false, + unbind_default_keys: false, keys: Default::default(), editor: Default::default(), } @@ -48,7 +48,7 @@ impl Config { pub fn with_default_keys() -> Self { Config { theme: None, - unbind_defaults: false, + unbind_default_keys: false, keys: default_keys(), editor: helix_view::editor::Config::default(), } @@ -90,7 +90,7 @@ impl Config { pub fn load(config_path: PathBuf) -> Result { match std::fs::read_to_string(config_path) { Ok(config) => match toml::from_str::(&config) { - Ok(config) if config.unbind_defaults => { + Ok(config) if config.unbind_default_keys => { Ok(config.replace_into_keys(Config::with_default_keys())) } Ok(config) => Ok(config.merge_into_keys(Config::with_default_keys())),