diff options
author | Canop <cano.petrole@gmail.com> | 2023-02-25 08:29:05 +0100 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2023-02-25 08:29:05 +0100 |
commit | 9b8124bbb377232b096c15a0c14fdb454394c382 (patch) | |
tree | 22e45fc178848c9cf60f3d03936ec59919940b85 | |
parent | 0a83711093413a7df4a63984d6064ee693cdbecf (diff) |
add log on $EDITOR resolution
-rw-r--r-- | resources/default-conf/verbs.hjson | 2 | ||||
-rw-r--r-- | src/launchable.rs | 2 | ||||
-rw-r--r-- | website/docs/file-operations.md | 4 |
3 files changed, 5 insertions, 3 deletions
diff --git a/resources/default-conf/verbs.hjson b/resources/default-conf/verbs.hjson index c5a1bcb..3cc533a 100644 --- a/resources/default-conf/verbs.hjson +++ b/resources/default-conf/verbs.hjson @@ -25,7 +25,7 @@ verbs: [ # can customize. # If $EDITOR isn't set on your computer, you should either set it using # something similar to - # export EDITOR=nvim + # export EDITOR=/usr/local/bin/nvim # or just replace it with your editor of choice in the 'execution' # pattern. # If your editor is able to open a file on a specific line, use {line} diff --git a/src/launchable.rs b/src/launchable.rs index c325ad0..bfde70a 100644 --- a/src/launchable.rs +++ b/src/launchable.rs @@ -73,8 +73,10 @@ fn resolve_env_variables(parts: Vec<String>) -> Vec<String> { continue; } if var_name == "EDITOR" { + debug!("Env var $EDITOR not set, looking at editor command for fallback"); if let Ok(editor) = which("editor") { if let Some(editor) = editor.to_str() { + debug!("Using editor solved as {editor:?}"); resolved.push(editor.to_string()); continue; } diff --git a/website/docs/file-operations.md b/website/docs/file-operations.md index 6aa51cf..162d0c4 100644 --- a/website/docs/file-operations.md +++ b/website/docs/file-operations.md @@ -68,7 +68,7 @@ As there's no argument, you may [define a key binding](../conf_verbs#keyboard-ke # create a file -The default configuration assumes the `$EDITOR` env variable is set. If it isn't and you can't set it, you should edit the `create` verb in the [configuration file](../conf_file). +The default configuration assumes a terminal editor is defined either with the `$EDITOR` env variable or with an `editor` command in the paths. If you don't have a default terminal editor, you should edit the `create` verb in the [configuration file](../conf_file). The desired parent being selected, type `:cr` then hit <kbd>tab</kbd> or a space, then the name of the new file: @@ -120,7 +120,7 @@ You finish by hitting <kbd>enter</kbd>. # edit a text file -The default configuration assumes the `$EDITOR` env variable is set. If it isn't and you can't set it, you should edit the `edit` verb in the [configuration file](../conf_file). +The default configuration assumes a terminal editor is defined in your system. If it isn't and you can't set it, you should edit the `edit` verb in the [configuration file](../conf_file). Select the file you want to edit, type `:e` then hit <kbd>enter</kbd>. |