diff --git a/complete.go b/complete.go index d2e04dcc..99582e0a 100644 --- a/complete.go +++ b/complete.go @@ -42,6 +42,7 @@ var ( "glob-select", "glob-unselect", "calcdirsize", + "clearmaps", "copy", "cut", "paste", diff --git a/doc.go b/doc.go index 096cf5f1..a0f4a883 100644 --- a/doc.go +++ b/doc.go @@ -41,6 +41,7 @@ The following commands are provided by lf: glob-select glob-unselect calcdirsize + clearmaps copy (default 'y') cut (default 'd') paste (default 'p') @@ -379,6 +380,12 @@ Calculate the total size for each of the selected directories. Option 'info' should include 'size' and option 'dircounts' should be disabled to show this size. If the total size of a directory is not calculated, it will be shown as '-'. + clearmaps + +Remove all keybindings associated with the `map` command. +This command can be used in the config file to remove the default keybindings. +For safety purposes, `:` is left mapped to the `read` command, and `cmap` keybindings are retained so that it is still possible to exit `lf` using `:quit`. + copy (default 'y') If there are no selections, save the path of the current file to the copy buffer, otherwise, copy the paths of selected files. diff --git a/docstring.go b/docstring.go index f7166701..c792d118 100644 --- a/docstring.go +++ b/docstring.go @@ -44,6 +44,7 @@ The following commands are provided by lf: glob-select glob-unselect calcdirsize + clearmaps copy (default 'y') cut (default 'd') paste (default 'p') @@ -395,6 +396,13 @@ should include 'size' and option 'dircounts' should be disabled to show this size. If the total size of a directory is not calculated, it will be shown as '-'. + clearmaps + +Remove all keybindings associated with the 'map' command. This command can be +used in the config file to remove the default keybindings. For safety purposes, +':' is left mapped to the 'read' command, and 'cmap' keybindings are retained so +that it is still possible to exit 'lf' using ':quit'. + copy (default 'y') If there are no selections, save the path of the current file to the copy diff --git a/eval.go b/eval.go index 0ddf107f..b3030339 100644 --- a/eval.go +++ b/eval.go @@ -1614,6 +1614,10 @@ func (e *callExpr) eval(app *app, args []string) { app.ui.loadFileInfo(app.nav) app.nav.sort() app.ui.sort() + case "clearmaps": + // leave `:` and cmaps bound so the user can still exit using `:quit` + gOpts.keys = make(map[string]expr) + gOpts.keys[":"] = &callExpr{"read", nil, 1} case "copy": if !app.nav.init { return diff --git a/lf.1 b/lf.1 index 6de2b894..fce47c2e 100644 --- a/lf.1 +++ b/lf.1 @@ -56,6 +56,7 @@ The following commands are provided by lf: glob-select glob-unselect calcdirsize + clearmaps copy (default 'y') cut (default 'd') paste (default 'p') @@ -441,6 +442,12 @@ Select/unselect files that match the given glob. .PP Calculate the total size for each of the selected directories. Option 'info' should include 'size' and option 'dircounts' should be disabled to show this size. If the total size of a directory is not calculated, it will be shown as '-'. .PP +.EX + clearmaps +.EE +.PP +Remove all keybindings associated with the `map` command. This command can be used in the config file to remove the default keybindings. For safety purposes, `:` is left mapped to the `read` command, and `cmap` keybindings are retained so that it is still possible to exit `lf` using `:quit`. +.PP .EX copy (default 'y') .EE