1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-05-17 22:32:58 +02:00

Add Zed editor support to editorPreset (#3886)

- **PR Description**

- **Please check if the PR fulfills these requirements**

* [X] Code has been formatted (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting))
* [ ] Tests have been added/updated (see
[here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md)
for the integration test guide)
* [X] Docs have been updated if necessary
* [X] You've read through your own file changes for silly mistakes etc
This commit is contained in:
Stefan Haller 2024-09-03 19:27:29 +02:00 committed by GitHub
commit 753b16b697
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 3 deletions

View File

@ -673,7 +673,7 @@ os:
editPreset: 'vscode' editPreset: 'vscode'
``` ```
Supported presets are `vim`, `nvim`, `nvim-remote`, `lvim`, `emacs`, `nano`, `micro`, `vscode`, `sublime`, `bbedit`, `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. Supported presets are `vim`, `nvim`, `nvim-remote`, `lvim`, `emacs`, `nano`, `micro`, `vscode`, `sublime`, `bbedit`, `kakoune`, `helix`, `xcode`, and `zed`. 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.
`nvim-remote` is an experimental preset for when you have invoked lazygit from within a neovim process, allowing lazygit to open the file from within the parent process rather than spawning a new one. `nvim-remote` is an experimental preset for when you have invoked lazygit from within a neovim process, allowing lazygit to open the file from within the parent process rather than spawning a new one.

View File

@ -113,6 +113,13 @@ func getPreset(osConfig *OSConfig, guessDefaultEditor func() string) *editPreset
openDirInEditorTemplate: "xed -- {{dir}}", openDirInEditorTemplate: "xed -- {{dir}}",
suspend: returnBool(false), suspend: returnBool(false),
}, },
"zed": {
editTemplate: "zed -- {{filename}}",
editAtLineTemplate: "zed -- {{filename}}:{{line}}",
editAtLineAndWaitTemplate: "zed --wait -- {{filename}}:{{line}}",
openDirInEditorTemplate: "zed -- {{dir}}",
suspend: returnBool(false),
},
} }
// 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.

View File

@ -546,7 +546,7 @@ type OSConfig struct {
// A built-in preset that sets all of the above settings. Supported presets // A built-in preset that sets all of the above settings. Supported presets
// are defined in the getPreset function in editor_presets.go. // are defined in the getPreset function in editor_presets.go.
EditPreset string `yaml:"editPreset,omitempty" jsonschema:"example=vim,example=nvim,example=emacs,example=nano,example=vscode,example=sublime,example=kakoune,example=helix,example=xcode"` EditPreset string `yaml:"editPreset,omitempty" jsonschema:"example=vim,example=nvim,example=emacs,example=nano,example=vscode,example=sublime,example=kakoune,example=helix,example=xcode,example=zed"`
// Command for opening a file, as if the file is double-clicked. Should // Command for opening a file, as if the file is double-clicked. Should
// contain "{{filename}}", but doesn't support "{{line}}". // contain "{{filename}}", but doesn't support "{{line}}".

View File

@ -788,7 +788,8 @@
"sublime", "sublime",
"kakoune", "kakoune",
"helix", "helix",
"xcode" "xcode",
"zed"
] ]
}, },
"open": { "open": {