diff options
author | Mark Kopenga <mkopenga@gmail.com> | 2021-08-23 10:15:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-23 10:15:38 +0200 |
commit | 487ad196a7c03d8cb3e0abc41dea42dd96db8a62 (patch) | |
tree | 589f36ab1814b4242e44d47fa398132bb958ad89 /pkg/config | |
parent | 508af269fbc255162d8a01c9788dae9445db0393 (diff) | |
parent | 44140adb921d7891778deb7f1aa2f813622302f4 (diff) |
Merge pull request #1413 from Ryooooooga/feature/edit-line
Make os.editCommand customizable using template
Diffstat (limited to 'pkg/config')
-rw-r--r-- | pkg/config/config_default_platform.go | 7 | ||||
-rw-r--r-- | pkg/config/config_linux.go | 7 | ||||
-rw-r--r-- | pkg/config/config_windows.go | 7 | ||||
-rw-r--r-- | pkg/config/user_config.go | 3 |
4 files changed, 15 insertions, 9 deletions
diff --git a/pkg/config/config_default_platform.go b/pkg/config/config_default_platform.go index fabdf8a88..0f56297d3 100644 --- a/pkg/config/config_default_platform.go +++ b/pkg/config/config_default_platform.go @@ -5,8 +5,9 @@ package config // GetPlatformDefaultConfig gets the defaults for the platform func GetPlatformDefaultConfig() OSConfig { return OSConfig{ - EditCommand: ``, - OpenCommand: "open {{filename}}", - OpenLinkCommand: "open {{link}}", + EditCommand: ``, + EditCommandTemplate: `{{editor}} {{filename}}`, + OpenCommand: "open {{filename}}", + OpenLinkCommand: "open {{link}}", } } diff --git a/pkg/config/config_linux.go b/pkg/config/config_linux.go index 8399e0e47..fe75b7322 100644 --- a/pkg/config/config_linux.go +++ b/pkg/config/config_linux.go @@ -3,8 +3,9 @@ package config // GetPlatformDefaultConfig gets the defaults for the platform func GetPlatformDefaultConfig() OSConfig { return OSConfig{ - EditCommand: ``, - OpenCommand: `sh -c "xdg-open {{filename}} >/dev/null"`, - OpenLinkCommand: `sh -c "xdg-open {{link}} >/dev/null"`, + EditCommand: ``, + EditCommandTemplate: `{{editor}} {{filename}}`, + OpenCommand: `sh -c "xdg-open {{filename}} >/dev/null"`, + OpenLinkCommand: `sh -c "xdg-open {{link}} >/dev/null"`, } } diff --git a/pkg/config/config_windows.go b/pkg/config/config_windows.go index f6780eb6b..71124808b 100644 --- a/pkg/config/config_windows.go +++ b/pkg/config/config_windows.go @@ -3,8 +3,9 @@ package config // GetPlatformDefaultConfig gets the defaults for the platform func GetPlatformDefaultConfig() OSConfig { return OSConfig{ - EditCommand: ``, - OpenCommand: `cmd /c "start "" {{filename}}"`, - OpenLinkCommand: `cmd /c "start "" {{link}}"`, + EditCommand: ``, + EditCommandTemplate: `{{editor}} {{filename}}`, + OpenCommand: `cmd /c "start "" {{filename}}"`, + OpenLinkCommand: `cmd /c "start "" {{link}}"`, } } diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go index 2f435f066..d2d98ac52 100644 --- a/pkg/config/user_config.go +++ b/pkg/config/user_config.go @@ -255,6 +255,9 @@ type OSConfig struct { // EditCommand is the command for editing a file EditCommand string `yaml:"editCommand,omitempty"` + // EditCommandTemplate is the command template for editing a file + EditCommandTemplate string `yaml:"editCommandTemplate,omitempty"` + // OpenCommand is the command for opening a file OpenCommand string `yaml:"openCommand,omitempty"` |