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() marks := app.nav.currMarks()
envFiles := strings.Join(marks, ":") envFiles := strings.Join(marks, gOpts.filesep)
os.Setenv("f", envFile) os.Setenv("f", envFile)
os.Setenv("fs", envFiles) os.Setenv("fs", envFiles)

View File

@ -58,6 +58,7 @@ var (
"preview!", "preview!",
"scrolloff", "scrolloff",
"tabstop", "tabstop",
"filesep",
"ifs", "ifs",
"previewer", "previewer",
"shell", "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) preview bool (default on)
scrolloff int (default 0) scrolloff int (default 0)
tabstop int (default 8) tabstop int (default 8)
filesep string (default ":")
ifs string (default "") (not exported if empty) ifs string (default "") (not exported if empty)
previewer string (default "") (not filtered if empty) previewer string (default "") (not filtered if empty)
shell string (default "$SHELL") 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) preview bool (default on)
scrolloff int (default 0) scrolloff int (default 0)
tabstop int (default 8) tabstop int (default 8)
filesep string (default ":")
ifs string (default "") (not exported if empty) ifs string (default "") (not exported if empty)
previewer string (default "") (not filtered if empty) previewer string (default "") (not filtered if empty)
shell string (default "$SHELL") shell string (default "$SHELL")

View File

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

View File

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