lf/opts.go

66 lines
1.8 KiB
Go
Raw Normal View History

2016-08-13 12:49:04 +00:00
package main
import "time"
2016-10-01 22:14:55 +00:00
var gOpts struct {
dirfirst bool
2016-08-13 12:49:04 +00:00
hidden bool
preview bool
scrolloff int
tabstop int
ifs string
previewer string
shell string
2016-08-13 12:49:04 +00:00
showinfo string
sortby string
timefmt string
2016-08-13 12:49:04 +00:00
ratios []int
keys map[string]Expr
cmds map[string]Expr
}
func init() {
gOpts.dirfirst = true
2016-08-13 12:49:04 +00:00
gOpts.hidden = false
gOpts.preview = true
gOpts.scrolloff = 0
gOpts.tabstop = 8
gOpts.shell = envShell
2016-08-13 12:49:04 +00:00
gOpts.showinfo = "none"
gOpts.sortby = "natural"
gOpts.timefmt = time.ANSIC
2016-08-13 12:49:04 +00:00
gOpts.ratios = []int{1, 2, 3}
gOpts.keys = make(map[string]Expr)
gOpts.keys["k"] = &CallExpr{"up", nil}
2016-08-13 18:37:09 +00:00
gOpts.keys["<up>"] = &CallExpr{"up", nil}
gOpts.keys["<c-u>"] = &CallExpr{"half-up", nil}
gOpts.keys["<c-b>"] = &CallExpr{"page-up", nil}
2016-08-13 18:37:09 +00:00
gOpts.keys["j"] = &CallExpr{"down", nil}
gOpts.keys["<down>"] = &CallExpr{"down", nil}
gOpts.keys["<c-d>"] = &CallExpr{"half-down", nil}
gOpts.keys["<c-f>"] = &CallExpr{"page-down", nil}
2016-08-13 12:49:04 +00:00
gOpts.keys["h"] = &CallExpr{"updir", nil}
2016-08-13 18:37:09 +00:00
gOpts.keys["<left>"] = &CallExpr{"updir", nil}
2016-08-13 12:49:04 +00:00
gOpts.keys["l"] = &CallExpr{"open", nil}
2016-08-13 18:37:09 +00:00
gOpts.keys["<right>"] = &CallExpr{"open", nil}
2016-08-13 12:49:04 +00:00
gOpts.keys["q"] = &CallExpr{"quit", nil}
gOpts.keys["G"] = &CallExpr{"bot", nil}
gOpts.keys["gg"] = &CallExpr{"top", nil}
gOpts.keys[":"] = &CallExpr{"read", nil}
gOpts.keys["$"] = &CallExpr{"read-shell", nil}
gOpts.keys["!"] = &CallExpr{"read-shell-wait", nil}
gOpts.keys["&"] = &CallExpr{"read-shell-async", nil}
gOpts.keys["/"] = &CallExpr{"search", nil}
gOpts.keys["?"] = &CallExpr{"search-back", nil}
gOpts.keys["<space>"] = &CallExpr{"toggle", nil}
gOpts.keys["v"] = &CallExpr{"invert", nil}
2016-08-13 12:49:04 +00:00
gOpts.keys["y"] = &CallExpr{"yank", nil}
gOpts.keys["d"] = &CallExpr{"delete", nil}
2016-11-06 15:09:18 +00:00
gOpts.keys["p"] = &CallExpr{"put", nil}
2016-08-24 09:36:52 +00:00
gOpts.keys["<c-l>"] = &CallExpr{"renew", nil}
2016-08-13 12:49:04 +00:00
gOpts.cmds = make(map[string]Expr)
}