From 82de51b9d3792b6602c3289de33d1fe950a970b8 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 15 Jul 2020 21:53:13 +0200 Subject: [PATCH] Document adding bindings This was never made explicit. [ci skip] --- doc_src/index.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/doc_src/index.rst b/doc_src/index.rst index 73ac36966..b3909e042 100644 --- a/doc_src/index.rst +++ b/doc_src/index.rst @@ -1587,6 +1587,28 @@ Visual mode - :kbd:`Escape` and :kbd:`Control`\ +\ :kbd:`C` enter `command mode <#vi-mode-command>`_. +.. _custom-binds: + +Custom bindings +--------------- + +In addition to the standard bindings listed here, you can also define your own with :ref:`bind `:: + + # Just clear the commandline on control-c + bind \cc 'commandline -r ""' + +Put ``bind`` statements into :ref:`config.fish ` or a function called ``fish_user_key_bindings``. + +The key sequence (the ``\cc``) here depends on your setup, in particular the terminal. To find out what the terminal sends use :ref:`fish_key_reader `:: + + > fish_key_reader + Press a key: + hex: 3 char: \cC + Press [ctrl-C] again to exit + bind \cC 'do something' + +Note that some key combinations are indistinguishable or unbindable. For instance control-i *is the same* as the tab key. This is a terminal limitation that fish can't do anything about. + .. _killring: Copy and paste (Kill Ring)