summaryrefslogtreecommitdiffstats
path: root/pkg/config
diff options
context:
space:
mode:
authorRyooooooga <eial5q265e5@gmail.com>2021-08-03 21:38:03 +0900
committerRyooooooga <eial5q265e5@gmail.com>2021-08-03 21:42:14 +0900
commit4f66093335e5a0d370cf43b3fc637c0795376334 (patch)
tree0f71e0ee748ff19133f5545492a4ddeb7f5f35b7 /pkg/config
parentd626bcac0029267d3f45223198902f5cb78d9dc1 (diff)
introduce edit command template to open a specifig line of a file
Diffstat (limited to 'pkg/config')
-rw-r--r--pkg/config/config_default_platform.go3
-rw-r--r--pkg/config/config_linux.go3
-rw-r--r--pkg/config/config_windows.go3
-rw-r--r--pkg/config/user_config.go5
4 files changed, 10 insertions, 4 deletions
diff --git a/pkg/config/config_default_platform.go b/pkg/config/config_default_platform.go
index fabdf8a88..cb6e338df 100644
--- a/pkg/config/config_default_platform.go
+++ b/pkg/config/config_default_platform.go
@@ -5,7 +5,8 @@ package config
// GetPlatformDefaultConfig gets the defaults for the platform
func GetPlatformDefaultConfig() OSConfig {
return OSConfig{
- EditCommand: ``,
+ Editor: ``,
+ EditCommand: `{{editor}} {{filename}}`,
OpenCommand: "open {{filename}}",
OpenLinkCommand: "open {{link}}",
}
diff --git a/pkg/config/config_linux.go b/pkg/config/config_linux.go
index 8399e0e47..1eed335f0 100644
--- a/pkg/config/config_linux.go
+++ b/pkg/config/config_linux.go
@@ -3,7 +3,8 @@ package config
// GetPlatformDefaultConfig gets the defaults for the platform
func GetPlatformDefaultConfig() OSConfig {
return OSConfig{
- EditCommand: ``,
+ Editor: ``,
+ EditCommand: `{{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..1bc919848 100644
--- a/pkg/config/config_windows.go
+++ b/pkg/config/config_windows.go
@@ -3,7 +3,8 @@ package config
// GetPlatformDefaultConfig gets the defaults for the platform
func GetPlatformDefaultConfig() OSConfig {
return OSConfig{
- EditCommand: ``,
+ Editor: ``,
+ EditCommand: `{{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 38259f6f2..ea079948e 100644
--- a/pkg/config/user_config.go
+++ b/pkg/config/user_config.go
@@ -252,7 +252,10 @@ type KeybindingSubmodulesConfig struct {
// OSConfig contains config on the level of the os
type OSConfig struct {
- // EditCommand is the command for editing a file
+ // Editor is the command for editing a file
+ Editor string `yaml:"editor,omitempty"`
+
+ // EditCommand is the command template for editing a file
EditCommand string `yaml:"editCommand,omitempty"`
// OpenCommand is the command for opening a file