diff --git a/crates/nu-cmd-base/src/util.rs b/crates/nu-cmd-base/src/util.rs index a2af4d4773..49c3f28f8b 100644 --- a/crates/nu-cmd-base/src/util.rs +++ b/crates/nu-cmd-base/src/util.rs @@ -78,10 +78,10 @@ pub fn get_editor( get_editor_commandline(&config.buffer_editor, "$env.config.buffer_editor") { Ok(buff_editor) - } else if let Some(value) = env_vars.get("EDITOR") { - get_editor_commandline(value, "$env.EDITOR") } else if let Some(value) = env_vars.get("VISUAL") { get_editor_commandline(value, "$env.VISUAL") + } else if let Some(value) = env_vars.get("EDITOR") { + get_editor_commandline(value, "$env.EDITOR") } else { Err(ShellError::GenericError { error: "No editor configured".into(), diff --git a/crates/nu-utils/src/sample_config/default_config.nu b/crates/nu-utils/src/sample_config/default_config.nu index 2fa4a5b5bf..7fd39cf460 100644 --- a/crates/nu-utils/src/sample_config/default_config.nu +++ b/crates/nu-utils/src/sample_config/default_config.nu @@ -238,7 +238,7 @@ $env.config = { color_config: $dark_theme # if you want a more interesting theme, you can replace the empty record with `$dark_theme`, `$light_theme` or another custom record footer_mode: 25 # always, never, number_of_rows, auto float_precision: 2 # the precision for displaying floats in tables - buffer_editor: null # command that will be used to edit the current line buffer with ctrl+o, if unset fallback to $env.EDITOR and $env.VISUAL + buffer_editor: null # command that will be used to edit the current line buffer with ctrl+o, if unset fallback to $env.VISUAL and $env.EDITOR use_ansi_coloring: true bracketed_paste: true # enable bracketed paste, currently useless on windows edit_mode: emacs # emacs, vi