add a filesep option to configure file seperator

Mentioned in #47.
This commit is contained in:
Gokcehan 2016-12-24 16:06:44 +03:00
parent f7e778591a
commit ad6ead5e45
6 changed files with 8 additions and 1 deletions

2
app.go
View File

@ -110,7 +110,7 @@ func (app *app) exportVars() {
marks := app.nav.currMarks()
envFiles := strings.Join(marks, ":")
envFiles := strings.Join(marks, gOpts.filesep)
os.Setenv("f", envFile)
os.Setenv("fs", envFiles)

View File

@ -58,6 +58,7 @@ var (
"preview!",
"scrolloff",
"tabstop",
"filesep",
"ifs",
"previewer",
"shell",

1
doc.go
View File

@ -53,6 +53,7 @@ The following options can be used to customize the behavior of lf:
preview bool (default on)
scrolloff int (default 0)
tabstop int (default 8)
filesep string (default ":")
ifs string (default "") (not exported if empty)
previewer string (default "") (not filtered if empty)
shell string (default "$SHELL")

View File

@ -57,6 +57,7 @@ The following options can be used to customize the behavior of lf:
preview bool (default on)
scrolloff int (default 0)
tabstop int (default 8)
filesep string (default ":")
ifs string (default "") (not exported if empty)
previewer string (default "") (not filtered if empty)
shell string (default "$SHELL")

View File

@ -69,6 +69,8 @@ func (e *setExpr) eval(app *app, args []string) {
return
}
gOpts.tabstop = n
case "filesep":
gOpts.filesep = e.val
case "ifs":
gOpts.ifs = e.val
case "previewer":

View File

@ -8,6 +8,7 @@ var gOpts struct {
preview bool
scrolloff int
tabstop int
filesep string
ifs string
previewer string
shell string
@ -25,6 +26,7 @@ func init() {
gOpts.preview = true
gOpts.scrolloff = 0
gOpts.tabstop = 8
gOpts.filesep = ":"
gOpts.shell = envShell
gOpts.showinfo = "none"
gOpts.sortby = "natural"