From 19c1108b1d68c3dc54b919887754511ded35357a Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Tue, 12 May 2026 23:11:25 +0200 Subject: [PATCH] support mate (TextMate) --- docs-master/Config.md | 2 +- docs/Config.md | 2 +- pkg/config/editor_presets.go | 7 +++++++ pkg/config/user_config.go | 2 +- schema-master/config.json | 3 ++- schema/config.json | 3 ++- 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/docs-master/Config.md b/docs-master/Config.md index 05d3b6d20f5..43e0ace655e 100644 --- a/docs-master/Config.md +++ b/docs-master/Config.md @@ -878,7 +878,7 @@ os: editPreset: 'vscode' ``` -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. +Supported presets are `vim`, `nvim`, `nvim-remote`, `lvim`, `emacs`, `nano`, `micro`, `vscode`, `sublime`, `bbedit`, `kakoune`, `helix`, `xcode`, `zed`, `acme` and `mate`. 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. diff --git a/docs/Config.md b/docs/Config.md index 9931fda61fe..01374199d8b 100644 --- a/docs/Config.md +++ b/docs/Config.md @@ -863,7 +863,7 @@ os: editPreset: 'vscode' ``` -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. +Supported presets are `vim`, `nvim`, `nvim-remote`, `lvim`, `emacs`, `nano`, `micro`, `vscode`, `sublime`, `bbedit`, `kakoune`, `helix`, `xcode`, `zed`, `acme` and `mate`. 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. diff --git a/pkg/config/editor_presets.go b/pkg/config/editor_presets.go index 5fcde97c54a..bb8101cfb22 100644 --- a/pkg/config/editor_presets.go +++ b/pkg/config/editor_presets.go @@ -151,6 +151,13 @@ func getPreset(shell string, osConfig *OSConfig, guessDefaultEditor func() strin openDirInEditorTemplate: "B {{dir}}", suspend: returnBool(false), }, + "mate": { + editTemplate: "mate -- {{filename}}", + editAtLineTemplate: "mate --line {{line}} -- {{filename}}", + editAtLineAndWaitTemplate: "mate --wait --line {{line}} -- {{filename}}", + openDirInEditorTemplate: "mate -- {{dir}}", + suspend: returnBool(false), + }, } // Some of our presets have a different name than the editor they are using. diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go index ddb0c087666..ab59beb0e48 100644 --- a/pkg/config/user_config.go +++ b/pkg/config/user_config.go @@ -641,7 +641,7 @@ type OSConfig struct { OpenDirInEditor string `yaml:"openDirInEditor,omitempty"` // A built-in preset that sets all of the above settings. Supported presets 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,example=zed,example=acme"` + 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,example=mate"` // Command for opening a file, as if the file is double-clicked. Should contain "{{filename}}", but doesn't support "{{line}}". Open string `yaml:"open,omitempty"` diff --git a/schema-master/config.json b/schema-master/config.json index 549b8087705..581047c1616 100644 --- a/schema-master/config.json +++ b/schema-master/config.json @@ -1720,7 +1720,8 @@ "helix", "xcode", "zed", - "acme" + "acme", + "mate" ] }, "open": { diff --git a/schema/config.json b/schema/config.json index c4312981fa2..8df7484abb3 100644 --- a/schema/config.json +++ b/schema/config.json @@ -1699,7 +1699,8 @@ "helix", "xcode", "zed", - "acme" + "acme", + "mate" ] }, "open": {