Use $VISUAL for the e command instead of $EDITOR (#1197)

* Use $VISUAL for the `e` command instead of $EDITOR

* update `os_windows.go` and `doc.go`
This commit is contained in:
RuMaks authored and GitHub committed 2023-04-09 01:44:09 +03:00
1 parent 1e1486fc02
commit 28b550a7ec
5 files changed
+18 -8

No files matched your search

+2 -1
View File
@@ -180,6 +180,7 @@ The following environment variables are exported for shell commands:
OLDPWD OLDPWD
LF_LEVEL LF_LEVEL
OPENER OPENER
VISUAL
EDITOR EDITOR
PAGER PAGER
SHELL SHELL
@@ -940,7 +941,7 @@ If this variable is set in the environment, use the same value. Otherwise, this
EDITOR EDITOR
If this variable is set in the environment, use the same value. Otherwise, this is set to 'vi' on Unix, 'notepad' in Windows. If VISUAL is set in the environment, use its value. Otherwise, use the value of the environment variable EDITOR. If neither variable is set, this is set to 'vi' on Unix, 'notepad' in Windows.
PAGER PAGER
+4 -2
View File
@@ -183,6 +183,7 @@ The following environment variables are exported for shell commands:
OLDPWD OLDPWD
LF_LEVEL LF_LEVEL
OPENER OPENER
VISUAL
EDITOR EDITOR
PAGER PAGER
SHELL SHELL
@@ -1005,8 +1006,9 @@ this is set to 'start' in Windows, 'open' in MacOS, 'xdg-open' in others.
EDITOR EDITOR
If this variable is set in the environment, use the same value. Otherwise, If VISUAL is set in the environment, use its value. Otherwise, use the value of
this is set to 'vi' on Unix, 'notepad' in Windows. the environment variable EDITOR. If neither variable is set, this is set to 'vi'
on Unix, 'notepad' in Windows.
PAGER PAGER
+2 -1
View File
@@ -201,6 +201,7 @@ The following environment variables are exported for shell commands:
OLDPWD OLDPWD
LF_LEVEL LF_LEVEL
OPENER OPENER
VISUAL
EDITOR EDITOR
PAGER PAGER
SHELL SHELL
@@ -1138,7 +1139,7 @@ If this variable is set in the environment, use the same value. Otherwise, this
EDITOR EDITOR
.EE .EE
.PP .PP
If this variable is set in the environment, use the same value. Otherwise, this is set to 'vi' on Unix, 'notepad' in Windows. If VISUAL is set in the environment, use its value. Otherwise, use the value of the environment variable EDITOR. If neither variable is set, this is set to 'vi' on Unix, 'notepad' in Windows.
.PP .PP
.EX .EX
PAGER PAGER
+5 -2
View File
@@ -18,7 +18,7 @@ import (
var ( var (
envOpener = os.Getenv("OPENER") envOpener = os.Getenv("OPENER")
envEditor = os.Getenv("EDITOR") envEditor = os.Getenv("VISUAL")
envPager = os.Getenv("PAGER") envPager = os.Getenv("PAGER")
envShell = os.Getenv("SHELL") envShell = os.Getenv("SHELL")
) )
@@ -51,7 +51,10 @@ func init() {
} }
if envEditor == "" { if envEditor == "" {
envEditor = "vi" envEditor = os.Getenv("EDITOR")
if envEditor == "" {
envEditor = "vi"
}
} }
if envPager == "" { if envPager == "" {
+5 -2
View File
@@ -14,7 +14,7 @@ import (
var ( var (
envOpener = os.Getenv("OPENER") envOpener = os.Getenv("OPENER")
envEditor = os.Getenv("EDITOR") envEditor = os.Getenv("VISUAL")
envPager = os.Getenv("PAGER") envPager = os.Getenv("PAGER")
envShell = os.Getenv("SHELL") envShell = os.Getenv("SHELL")
) )
@@ -45,7 +45,10 @@ func init() {
} }
if envEditor == "" { if envEditor == "" {
envEditor = "notepad" envEditor = os.Getenv("EDITOR")
if envEditor == "" {
envEditor = "notepad"
}
} }
if envPager == "" { if envPager == "" {