Add docs on custom key bindings + error message for unhandled actions

This commit is contained in:
David Dworken 2024-04-28 11:33:27 -07:00
parent aeaf1ad005
commit f3d467b4a7
No known key found for this signature in database
2 changed files with 9 additions and 1 deletions

View File

@ -121,6 +121,13 @@ You can customize hishtory's color scheme for the TUI. Run `hishtory config-set
</blockquote></details>
<details>
<summary>Custom Key Bindings</summary><blockquote>
You can customize hishtory's key bindings for the TUI. Run `hishtory config-get key-bindings` to see the current key bindings. You can then run `hishtory config-set key-bindings $action $keybinding` to configure custom key bindings.
</blockquote></details>
<details>
<summary>Disabling Control+R integration</summary><blockquote>
@ -195,7 +202,6 @@ Note that this uses [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access
</blockquote></details>
<details>
<summary>Customizing the install folder</summary><blockquote>

View File

@ -77,6 +77,8 @@ var setKeyBindingsCmd = &cobra.Command{
config.KeyBindings.WordLeft = args[1:]
case "word-right":
config.KeyBindings.WordRight = args[1:]
default:
lib.CheckFatalError(fmt.Errorf("unknown action %q, run `hishtory config-get keybindings` to see the list of currently configured key bindings", args[0]))
}
lib.CheckFatalError(hctx.SetConfig(config))
},