pub fn editor_open_config_command(path: &Path) -> StringExpand description
What: Build a shell command string that opens a config file in the user’s preferred terminal editor.
Inputs:
path: Path to the config file to open.
Output:
- A single shell expression that tries, in order:
$VISUAL,$EDITOR, then the built-in fallback chain (nvim, vim, hx, helix, emacsclient, emacs, nano), and finally a fallback message withread -rn1 -s _.
Details:
- The script expects
VISUAL/EDITORto be runnable commands that accept a file path. - The path is passed through
shell_single_quoteso paths with spaces or single quotes are safe. - Order: VISUAL then EDITOR then nvim → vim → hx → helix → emacsclient -t → emacs -nw → nano.