editor_open_config_command

Function editor_open_config_command 

Source
pub fn editor_open_config_command(path: &Path) -> String
Expand 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 with read -rn1 -s _.

Details:

  • The script expects VISUAL/EDITOR to be runnable commands that accept a file path.
  • The path is passed through shell_single_quote so paths with spaces or single quotes are safe.
  • Order: VISUAL then EDITOR then nvim → vim → hx → helix → emacsclient -t → emacs -nw → nano.