diff options
-rw-r--r-- | book/src/generated/typable-cmd.md | 1 | ||||
-rw-r--r-- | helix-term/src/commands/typed.rs | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/book/src/generated/typable-cmd.md b/book/src/generated/typable-cmd.md index 17d10c99..5ae184da 100644 --- a/book/src/generated/typable-cmd.md +++ b/book/src/generated/typable-cmd.md @@ -63,5 +63,6 @@ | `:tree-sitter-subtree`, `:ts-subtree` | Display tree sitter subtree under cursor, primarily for debugging queries. | | `:config-reload` | Refreshes helix's config. | | `:config-open` | Open the helix config.toml file. | +| `:log-open` | Open the helix log file. | | `:pipe` | Pipe each selection to the shell command. | | `:run-shell-command`, `:sh` | Run a shell command | diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index 68b64bb8..74ab73be 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -1146,6 +1146,15 @@ fn open_config( Ok(()) } +fn open_log( + cx: &mut compositor::Context, + _args: &[Cow<str>], + _event: PromptEvent, +) -> anyhow::Result<()> { + cx.editor.open(helix_loader::log_file(), Action::Replace)?; + Ok(()) +} + fn refresh_config( cx: &mut compositor::Context, _args: &[Cow<str>], @@ -1648,6 +1657,13 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[ completer: None, }, TypableCommand { + name: "log-open", + aliases: &[], + doc: "Open the helix log file.", + fun: open_log, + completer: None, + }, + TypableCommand { name: "pipe", aliases: &[], doc: "Pipe each selection to the shell command.", |