summaryrefslogtreecommitdiffstats
path: root/pkg/config/user_config.go
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2023-03-26 14:04:09 +0200
committerStefan Haller <stefan@haller-berlin.de>2023-04-13 13:14:00 +0200
commit659d668e16c3aac63ca7c41bba06003b6b1f8023 (patch)
treec35e2369269851793d05b9d666ddb002c0b9068d /pkg/config/user_config.go
parent7bbcec965bb6606c661287f3a729a1de08debd81 (diff)
Implement edit presets
Diffstat (limited to 'pkg/config/user_config.go')
-rw-r--r--pkg/config/user_config.go31
1 files changed, 30 insertions, 1 deletions
diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go
index df421b03c..a7be98c9c 100644
--- a/pkg/config/user_config.go
+++ b/pkg/config/user_config.go
@@ -291,10 +291,39 @@ type KeybindingSubmodulesConfig struct {
// OSConfig contains config on the level of the os
type OSConfig struct {
- // EditCommand is the command for editing a file
+ // Command for editing a file. Should contain "{{filename}}".
+ Edit string `yaml:"edit,omitempty"`
+
+ // Command for editing a file at a given line number. Should contain
+ // "{{filename}}", and may optionally contain "{{line}}".
+ EditAtLine string `yaml:"editAtLine,omitempty"`
+
+ // Same as EditAtLine, except that the command needs to wait until the
+ // window is closed.
+ EditAtLineAndWait string `yaml:"editAtLineAndWait,omitempty"`
+
+ // Whether the given edit commands use the terminal. Used to decide whether
+ // lazygit needs to suspend to the background before calling the editor.
+ // Pointer to bool so that we can distinguish unset (nil) from false.
+ EditInTerminal *bool `yaml:"editInTerminal,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"`
+
+ // --------
+
+ // The following configs are all deprecated and kept for backward
+ // compatibility. They will be removed in the future.
+
+ // EditCommand is the command for editing a file.
+ // Deprecated: use Edit instead. Note that semantics are different:
+ // EditCommand is just the command itself, whereas Edit contains a
+ // "{{filename}}" variable.
EditCommand string `yaml:"editCommand,omitempty"`
// EditCommandTemplate is the command template for editing a file
+ // Deprecated: use EditAtLine instead.
EditCommandTemplate string `yaml:"editCommandTemplate,omitempty"`
// OpenCommand is the command for opening a file