Skip to content

Commit 19ac926

Browse files
authored
Add acme editor preset (#4360)
- **PR Description** Add editor preset for the acme editor (http://acme.cat-v.org/) - **Please check if the PR fulfills these requirements** * [x] Cheatsheets are up-to-date (run `go generate ./...`) * [x] Code has been formatted (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting)) * [x] Tests have been added/updated (see [here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md) for the integration test guide) * [x] Text is internationalised (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation)) * [x] If a new UserConfig entry was added, make sure it can be hot-reloaded (see [here](https://github.com/jesseduffield/lazygit/blob/master/docs/dev/Codebase_Guide.md#using-userconfig)) * [x] Docs have been updated if necessary * [x] You've read through your own file changes for silly mistakes etc
2 parents 0b9f320 + f989425 commit 19ac926

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

docs/Config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ os:
715715
editPreset: 'vscode'
716716
```
717717

718-
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.
718+
Supported presets are `vim`, `nvim`, `nvim-remote`, `lvim`, `emacs`, `nano`, `micro`, `vscode`, `sublime`, `bbedit`, `kakoune`, `helix`, `xcode`, `zed` and `acme`. 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.
719719

720720
`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.
721721

pkg/config/editor_presets.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,13 @@ func getPreset(osConfig *OSConfig, guessDefaultEditor func() string) *editPreset
126126
openDirInEditorTemplate: "zed -- {{dir}}",
127127
suspend: returnBool(false),
128128
},
129+
"acme": {
130+
editTemplate: "B {{filename}}",
131+
editAtLineTemplate: "B {{filename}}:{{line}}",
132+
editAtLineAndWaitTemplate: "E {{filename}}:{{line}}",
133+
openDirInEditorTemplate: "B {{dir}}",
134+
suspend: returnBool(false),
135+
},
129136
}
130137

131138
// Some of our presets have a different name than the editor they are using.

pkg/config/user_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ type OSConfig struct {
566566

567567
// A built-in preset that sets all of the above settings. Supported presets
568568
// are defined in the getPreset function in editor_presets.go.
569-
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"`
569+
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,example=acme"`
570570

571571
// Command for opening a file, as if the file is double-clicked. Should
572572
// contain "{{filename}}", but doesn't support "{{line}}".

schema/config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1494,7 +1494,8 @@
14941494
"kakoune",
14951495
"helix",
14961496
"xcode",
1497-
"zed"
1497+
"zed",
1498+
"acme"
14981499
]
14991500
},
15001501
"open": {

0 commit comments

Comments
 (0)