docs(mapping): document the leader tree and palette remapping
This commit is contained in:
2 files changed
+76
No files matched your search
@@ -428,11 +428,61 @@ below::
|
||||
map --new-mode XXX --on-action end ...
|
||||
|
||||
|
||||
.. _leader_keymap:
|
||||
|
||||
Leader key and which-key hints
|
||||
-----------------------------------
|
||||
|
||||
The leader key turns a group of multi-key mappings into a discoverable tree.
|
||||
Set :opt:`leader` to the prefix you want to use, then define mappings that
|
||||
start with that prefix::
|
||||
|
||||
leader ctrl+space
|
||||
|
||||
map ctrl+space>n new_os_window
|
||||
map ctrl+space>w new_window
|
||||
map ctrl+space>t new_tab
|
||||
map ctrl+space>c close_window
|
||||
|
||||
Pressing :kbd:`Ctrl+Space` immediately opens a panel listing every key that can
|
||||
follow, with the action it runs and its help text. Press the key shown in the
|
||||
first column to run the action directly, or use the arrow keys and
|
||||
:kbd:`Enter`/ :kbd:`Escape` to leave. No timeout is needed: the panel opens as
|
||||
soon as the leader key is pressed.
|
||||
|
||||
The panel reads the same structured mapping data as the :doc:`command palette
|
||||
</kittens/command-palette>` and :doc:`the shortcuts help panel
|
||||
</kittens/help>`, so every action they list is also available here. Bindings
|
||||
guarded by :code:`--when-focus-on` are filtered against the focused window
|
||||
before they are shown.
|
||||
|
||||
The leader key is only intercepted when multi-key mappings actually start with
|
||||
it. Otherwise it is passed to the program running in the window normally. Set
|
||||
:opt:`leader` to :code:`none` to disable the panel.
|
||||
|
||||
|
||||
All mappable actions
|
||||
------------------------
|
||||
|
||||
There is a list of :doc:`all mappable actions <actions>`.
|
||||
|
||||
Remapping from the command palette
|
||||
---------------------------------
|
||||
|
||||
Every entry in the command palette shows the shortcut currently bound to it.
|
||||
Select an action and press :kbd:`Ctrl+R` to remap it: the footer asks for the
|
||||
new shortcut, so press the key combination you want. The palette appends a
|
||||
:code:`map` directive to :file:`kitty.conf` and reloads the configuration, so
|
||||
the new shortcut is active immediately::
|
||||
|
||||
map ctrl+alt+n new_os_window
|
||||
|
||||
The change is appended to the end of the file, it never rewrites existing lines.
|
||||
A later mapping for the same key wins, as usual in :file:`kitty.conf`. Remove
|
||||
the line manually to undo the change. Remapping is disabled in the read-only
|
||||
shortcuts help panel and for mouse bindings.
|
||||
|
||||
|
||||
Debugging mapping issues
|
||||
------------------------------
|
||||
|
||||
|
||||
Reference in new issue
Block a user