Commit 2808d8e4ea
Unsigned
Layout: unified · split
internal/curd.go +11 −2
| @@ -34,8 +34,17 @@ func EditConfig(configFilePath string) { | ||
| 34 | 34 | // Get the user's preferred editor from the EDITOR environment variable |
| 35 | 35 | editor := os.Getenv("EDITOR") |
| 36 | 36 | if editor == "" { |
| 37 | // If EDITOR is not set, default to "vim" | |
| 38 | editor = "vim" | |
| 37 | // If EDITOR is not set, use system-specific defaults | |
| 38 | if runtime.GOOS == "windows" { | |
| 39 | // Try Notepad++ first | |
| 40 | if _, err := exec.LookPath("notepad++"); err == nil { | |
| 41 | editor = "notepad++" | |
| 42 | } else { | |
| 43 | editor = "notepad.exe" | |
| 44 | } | |
| 45 | } else { | |
| 46 | editor = "vim" | |
| 47 | } | |
| 39 | 48 | } |
| 40 | 49 | |
| 41 | 50 | // Construct the command to open the config file |