New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add helix editor preset #2668
Add helix editor preset #2668
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ func getPreset(osConfig *OSConfig, guessDefaultEditor func() string) *editPreset | |
"emacs": standardTerminalEditorPreset("emacs"), | ||
"nano": standardTerminalEditorPreset("nano"), | ||
"kakoune": standardTerminalEditorPreset("kakoune"), | ||
"hx": helixEditorPreset(), | ||
"vscode": { | ||
editTemplate: "code --reuse-window -- {{filename}}", | ||
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, | ||
} | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All the other presets (except the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair points. I've raised a PR for this: #2673 |
||
func getEditInTerminal(osConfig *OSConfig, preset *editPreset) bool { | ||
if osConfig.EditInTerminal != nil { | ||
return *osConfig.EditInTerminal | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the name of the preset be
helix
rather thanhx
? That's whatConfig.md
above says, and I'd prefer the more descriptive name (like with "code" vs. "vscode"). We'll then need an entry"hx": "helix",
in theeditorToPreset
map below.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, this one bit me!