rename 'open-file' to 'open'
This commit is contained in:
1 parent
07c16fede0
commit
96f35e986d
6 files changed
+29
-30
No files matched your search
@@ -503,20 +503,20 @@ completely are provided in the example configuration file.
|
||||
|
||||
Opening Files
|
||||
|
||||
You can use 'open-file' command to open a file. This is a special command
|
||||
called by 'open' when the current file is not a directory. Normally a user maps
|
||||
the 'open' command to a key (default 'l') and customize 'open-file' command as
|
||||
desired. You can define it just as you would define any other command:
|
||||
You can define a an 'open' command (default 'l') to configure file opening.
|
||||
This command is only called when the current file is not a directory, otherwise
|
||||
the directory is entered instead. You can define it just as you would define
|
||||
any other command:
|
||||
|
||||
cmd open-file $vi $fx
|
||||
cmd open $vi $fx
|
||||
|
||||
It is possible to use different command types:
|
||||
|
||||
cmd open-file &xdg-open $f
|
||||
cmd open &xdg-open $f
|
||||
|
||||
You may want to use either file extensions or mime types from 'file' command:
|
||||
|
||||
cmd open-file ${{
|
||||
cmd open ${{
|
||||
case $(file --mime-type $f -b) in
|
||||
text/*) vi $fx;;
|
||||
*) for f in $fx; do xdg-open $f > /dev/null 2> /dev/null & done;;
|
||||
@@ -525,9 +525,9 @@ You may want to use either file extensions or mime types from 'file' command:
|
||||
|
||||
Following commands are provided by default:
|
||||
|
||||
cmd open-file &start %f% # windows
|
||||
cmd open-file &open "$f" # macos
|
||||
cmd open-file &xdg-open "$f" # others
|
||||
cmd open &start %f% # windows
|
||||
cmd open &open "$f" # macos
|
||||
cmd open &xdg-open "$f" # others
|
||||
|
||||
You may also use any other existing file openers as you like. Possible options
|
||||
are 'libfile-mimeinfo-perl' (executable name is 'mimeopen'), 'rifle' (ranger's
|
||||
|
||||
+10
-11
@@ -529,22 +529,21 @@ files completely are provided in the example configuration file.
|
||||
|
||||
Opening Files
|
||||
|
||||
You can use 'open-file' command to open a file. This is a special command
|
||||
called by 'open' when the current file is not a directory. Normally a user
|
||||
maps the 'open' command to a key (default 'l') and customize 'open-file'
|
||||
command as desired. You can define it just as you would define any other
|
||||
command:
|
||||
You can define a an 'open' command (default 'l') to configure file opening.
|
||||
This command is only called when the current file is not a directory,
|
||||
otherwise the directory is entered instead. You can define it just as you
|
||||
would define any other command:
|
||||
|
||||
cmd open-file $vi $fx
|
||||
cmd open $vi $fx
|
||||
|
||||
It is possible to use different command types:
|
||||
|
||||
cmd open-file &xdg-open $f
|
||||
cmd open &xdg-open $f
|
||||
|
||||
You may want to use either file extensions or mime types from 'file'
|
||||
command:
|
||||
|
||||
cmd open-file ${{
|
||||
cmd open ${{
|
||||
case $(file --mime-type $f -b) in
|
||||
text/*) vi $fx;;
|
||||
*) for f in $fx; do xdg-open $f > /dev/null 2> /dev/null & done;;
|
||||
@@ -553,9 +552,9 @@ command:
|
||||
|
||||
Following commands are provided by default:
|
||||
|
||||
cmd open-file &start %f% # windows
|
||||
cmd open-file &open "$f" # macos
|
||||
cmd open-file &xdg-open "$f" # others
|
||||
cmd open &start %f% # windows
|
||||
cmd open &open "$f" # macos
|
||||
cmd open &xdg-open "$f" # others
|
||||
|
||||
You may also use any other existing file openers as you like. Possible
|
||||
options are 'libfile-mimeinfo-perl' (executable name is 'mimeopen'), 'rifle'
|
||||
|
||||
+5
-5
@@ -34,11 +34,11 @@ map O $mimeopen --ask $f
|
||||
# show documentation (overrides 'search-back' command)
|
||||
map ? $lf -doc | less
|
||||
|
||||
# define a custom 'open-file' command
|
||||
# 'open-file' is called by 'open' when current file is not a directory. You may
|
||||
# want to use either file extensions and/or mime types here. Below uses an
|
||||
# editor for text files and a file opener for the rest.
|
||||
cmd open-file ${{
|
||||
# define a custom 'open' command
|
||||
# This command is called when current file is not a directory. You may want to
|
||||
# use either file extensions and/or mime types here. Below uses an editor for
|
||||
# text files and a file opener for the rest.
|
||||
cmd open ${{
|
||||
case $(file --mime-type $f -b) in
|
||||
text/*) vi $fx;;
|
||||
*) for f in $fx; do xdg-open $f > /dev/null 2> /dev/null & done;;
|
||||
|
||||
@@ -333,7 +333,7 @@ func (e *callExpr) eval(app *app, args []string) {
|
||||
return
|
||||
}
|
||||
|
||||
if cmd, ok := gOpts.cmds["open-file"]; ok {
|
||||
if cmd, ok := gOpts.cmds["open"]; ok {
|
||||
cmd.eval(app, e.args)
|
||||
}
|
||||
case "quit":
|
||||
|
||||
@@ -118,9 +118,9 @@ func setDefaults() {
|
||||
}
|
||||
|
||||
if runtime.GOOS == "darwin" {
|
||||
gOpts.cmds["open-file"] = &execExpr{"&", `open "$f"`}
|
||||
gOpts.cmds["open"] = &execExpr{"&", `open "$f"`}
|
||||
} else {
|
||||
gOpts.cmds["open-file"] = &execExpr{"&", `xdg-open "$f"`}
|
||||
gOpts.cmds["open"] = &execExpr{"&", `xdg-open "$f"`}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ func setDefaults() {
|
||||
gOpts.keys["e"] = &execExpr{"$", `notepad %f%`}
|
||||
gOpts.keys["i"] = &execExpr{"$", `more %f%`}
|
||||
gOpts.keys["w"] = &execExpr{"$", "cmd"}
|
||||
gOpts.cmds["open-file"] = &execExpr{"&", `start %f%`}
|
||||
gOpts.cmds["open"] = &execExpr{"&", `start %f%`}
|
||||
}
|
||||
|
||||
func moveCursor(y, x int) {
|
||||
|
||||
Reference in new issue
Block a user