mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 04:45:47 +02:00
Provide two helix presets, one for "helix" and one for "hx" (#3346)
The helix binary seems to be called "helix" on some distributions (e.g. Arch), but "hx" on others (e.g. Fedora). Provide presets for both, so that auto-detection from $EDITOR works. See https://github.com/jesseduffield/lazygit/issues/2624#issuecomment-1966509979.
This commit is contained in:
commit
ed34ddc04d
1 changed files with 13 additions and 5 deletions
|
@ -65,6 +65,13 @@ func getPreset(osConfig *OSConfig, guessDefaultEditor func() string) *editPreset
|
||||||
"nano": standardTerminalEditorPreset("nano"),
|
"nano": standardTerminalEditorPreset("nano"),
|
||||||
"kakoune": standardTerminalEditorPreset("kak"),
|
"kakoune": standardTerminalEditorPreset("kak"),
|
||||||
"helix": {
|
"helix": {
|
||||||
|
editTemplate: "helix -- {{filename}}",
|
||||||
|
editAtLineTemplate: "helix -- {{filename}}:{{line}}",
|
||||||
|
editAtLineAndWaitTemplate: "helix -- {{filename}}:{{line}}",
|
||||||
|
openDirInEditorTemplate: "helix -- {{dir}}",
|
||||||
|
suspend: true,
|
||||||
|
},
|
||||||
|
"helix (hx)": {
|
||||||
editTemplate: "hx -- {{filename}}",
|
editTemplate: "hx -- {{filename}}",
|
||||||
editAtLineTemplate: "hx -- {{filename}}:{{line}}",
|
editAtLineTemplate: "hx -- {{filename}}:{{line}}",
|
||||||
editAtLineAndWaitTemplate: "hx -- {{filename}}:{{line}}",
|
editAtLineAndWaitTemplate: "hx -- {{filename}}:{{line}}",
|
||||||
|
@ -103,11 +110,12 @@ func getPreset(osConfig *OSConfig, guessDefaultEditor func() string) *editPreset
|
||||||
|
|
||||||
// Some of our presets have a different name than the editor they are using.
|
// Some of our presets have a different name than the editor they are using.
|
||||||
editorToPreset := map[string]string{
|
editorToPreset := map[string]string{
|
||||||
"kak": "kakoune",
|
"kak": "kakoune",
|
||||||
"hx": "helix",
|
"helix": "helix",
|
||||||
"code": "vscode",
|
"hx": "helix (hx)",
|
||||||
"subl": "sublime",
|
"code": "vscode",
|
||||||
"xed": "xcode",
|
"subl": "sublime",
|
||||||
|
"xed": "xcode",
|
||||||
}
|
}
|
||||||
|
|
||||||
presetName := osConfig.EditPreset
|
presetName := osConfig.EditPreset
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue