package main import "time" var gOpts struct { dircounts bool dirfirst bool globsearch bool hidden bool ignorecase bool preview bool reverse bool smartcase bool wrapscan bool scrolloff int tabstop int filesep string ifs string previewer string promptfmt string shell string sortby string timefmt string ratios []int info []string keys map[string]expr cmdkeys map[string]expr cmds map[string]expr } func init() { gOpts.dircounts = false gOpts.dirfirst = true gOpts.globsearch = false gOpts.hidden = false gOpts.ignorecase = true gOpts.preview = true gOpts.reverse = false gOpts.smartcase = true gOpts.wrapscan = true gOpts.scrolloff = 0 gOpts.tabstop = 8 gOpts.filesep = "\n" gOpts.promptfmt = "\033[32;1m%u@%h\033[0m:\033[34;1m%w/\033[0m\033[1m%f\033[0m" gOpts.shell = gDefaultShell gOpts.sortby = "natural" gOpts.timefmt = time.ANSIC gOpts.ratios = []int{1, 2, 3} gOpts.info = nil gOpts.keys = make(map[string]expr) gOpts.keys["k"] = &callExpr{"up", nil} gOpts.keys[""] = &callExpr{"up", nil} gOpts.keys[""] = &callExpr{"half-up", nil} gOpts.keys[""] = &callExpr{"page-up", nil} gOpts.keys["j"] = &callExpr{"down", nil} gOpts.keys[""] = &callExpr{"down", nil} gOpts.keys[""] = &callExpr{"half-down", nil} gOpts.keys[""] = &callExpr{"page-down", nil} gOpts.keys["h"] = &callExpr{"updir", nil} gOpts.keys[""] = &callExpr{"updir", nil} gOpts.keys["l"] = &callExpr{"open", nil} gOpts.keys[""] = &callExpr{"open", nil} gOpts.keys["q"] = &callExpr{"quit", nil} gOpts.keys["gg"] = &callExpr{"top", nil} gOpts.keys["G"] = &callExpr{"bot", nil} gOpts.keys[""] = &callExpr{"toggle", nil} gOpts.keys["v"] = &callExpr{"invert", nil} gOpts.keys["u"] = &callExpr{"unmark", nil} gOpts.keys["y"] = &callExpr{"yank", nil} gOpts.keys["d"] = &callExpr{"delete", nil} gOpts.keys["c"] = &callExpr{"clear", nil} gOpts.keys["p"] = &callExpr{"put", nil} gOpts.keys[""] = &callExpr{"redraw", nil} gOpts.keys[""] = &callExpr{"reload", 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["n"] = &callExpr{"search-next", nil} gOpts.keys["N"] = &callExpr{"search-prev", nil} gOpts.keys[""] = &callExpr{"cmd-hist-next", nil} gOpts.keys[""] = &callExpr{"cmd-hist-prev", nil} gOpts.cmdkeys = make(map[string]expr) // TODO: rest of the keys gOpts.cmdkeys[""] = &callExpr{"cmd-insert", []string{" "}} gOpts.cmdkeys[""] = &callExpr{"cmd-escape", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-comp", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-enter", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-enter", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-hist-next", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-hist-prev", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-delete", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-delete", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-delete-back", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-delete-back", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-left", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-left", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-right", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-right", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-beg", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-beg", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-end", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-end", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-delete-beg", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-delete-end", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-delete-word", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-put", nil} gOpts.cmdkeys[""] = &callExpr{"cmd-transpose", nil} gOpts.cmds = make(map[string]expr) }