@@ -928,9 +928,30 @@ pub(super) fn goto_line_number(
928928 Ok(())
929929}
930930
931+// Fetch the current value of a config option and output as status.
932+fn get_option(
933+ cx: &mut compositor::Context,
934+ args: &[Cow<str>],
935+ _event: PromptEvent,
936+) -> anyhow::Result<()> {
937+ if args.len() != 1 {
938+ anyhow::bail!("Bad arguments. Usage: `:get key`");
939+ }
940+
941+ let key = &args[0].to_lowercase();
942+ let key_error = || anyhow::anyhow!("Unknown key `{}`", key);
943+
944+ let config = serde_json::to_value(&cx.editor.config().clone()).unwrap();
945+ let pointer = format!("/{}", key.replace('.', "/"));
946+ let value = config.pointer(&pointer).ok_or_else(key_error)?;
947+
948+ cx.editor.set_status(value.to_string());
949+ Ok(())
950+}
951+
931952/// Change config at runtime. Access nested values by dot syntax, for
932953/// example to disable smart case search, use `:set search.smart-case false`.
933−fn setting(
954+fn set_option(
934955 cx: &mut compositor::Context,
935956 args: &[Cow<str>],
936957 _event: PromptEvent,
@@ -1487,8 +1508,15 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
14871508 TypableCommand {
14881509 name: "set-option",
14891510 aliases: &["set"],
1490− doc: "Set a config option at runtime",
1491− fun: setting,
1511+ doc: "Set a config option at runtime.",
1512+ fun: set_option,
1513+ completer: Some(completers::setting),
1514+ },
1515+ TypableCommand {
1516+ name: "get-option",
1517+ aliases: &["get"],
1518+ doc: "Get the current value of a config option.",
1519+ fun: get_option,
14921520 completer: Some(completers::setting),
14931521 },
14941522 TypableCommand {