mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-11-25 22:32:13 +02:00
Add helix editor preset
This commit is contained in:
@@ -289,7 +289,7 @@ os:
|
|||||||
```
|
```
|
||||||
|
|
||||||
Supported presets are `vim`, `nvim`, `emacs`, `nano`, `vscode`, `sublime`, `bbedit`,
|
Supported presets are `vim`, `nvim`, `emacs`, `nano`, `vscode`, `sublime`, `bbedit`,
|
||||||
`kakoune` and `xcode`. In many cases lazygit will be able to guess the right preset
|
`kakoune`, `helix`, and `xcode`. In many cases lazygit will be able to guess the right preset
|
||||||
from your $(git config core.editor), or an environment variable such as $VISUAL or $EDITOR.
|
from your $(git config core.editor), or an environment variable such as $VISUAL or $EDITOR.
|
||||||
|
|
||||||
If for some reason you are not happy with the default commands from a preset, or
|
If for some reason you are not happy with the default commands from a preset, or
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ func getPreset(osConfig *OSConfig, guessDefaultEditor func() string) *editPreset
|
|||||||
"emacs": standardTerminalEditorPreset("emacs"),
|
"emacs": standardTerminalEditorPreset("emacs"),
|
||||||
"nano": standardTerminalEditorPreset("nano"),
|
"nano": standardTerminalEditorPreset("nano"),
|
||||||
"kakoune": standardTerminalEditorPreset("kakoune"),
|
"kakoune": standardTerminalEditorPreset("kakoune"),
|
||||||
|
"hx": helixEditorPreset(),
|
||||||
"vscode": {
|
"vscode": {
|
||||||
editTemplate: "code --reuse-window -- {{filename}}",
|
editTemplate: "code --reuse-window -- {{filename}}",
|
||||||
editAtLineTemplate: "code --reuse-window --goto -- {{filename}}:{{line}}",
|
editAtLineTemplate: "code --reuse-window --goto -- {{filename}}:{{line}}",
|
||||||
@@ -104,6 +105,15 @@ func standardTerminalEditorPreset(editor string) *editPreset {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func helixEditorPreset() *editPreset {
|
||||||
|
return &editPreset{
|
||||||
|
editTemplate: "hx -- {{filename}}",
|
||||||
|
editAtLineTemplate: "hx -- {{filename}}:{{line}}",
|
||||||
|
editAtLineAndWaitTemplate: "hx -- {{filename}}:{{line}}",
|
||||||
|
editInTerminal: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func getEditInTerminal(osConfig *OSConfig, preset *editPreset) bool {
|
func getEditInTerminal(osConfig *OSConfig, preset *editPreset) bool {
|
||||||
if osConfig.EditInTerminal != nil {
|
if osConfig.EditInTerminal != nil {
|
||||||
return *osConfig.EditInTerminal
|
return *osConfig.EditInTerminal
|
||||||
|
|||||||
Reference in New Issue
Block a user