diff --git a/doc_src/cmds/bind.rst b/doc_src/cmds/bind.rst index 63ca1e930..bdd72a46d 100644 --- a/doc_src/cmds/bind.rst +++ b/doc_src/cmds/bind.rst @@ -228,7 +228,7 @@ Perform a history search when :kbd:`Page Up` is pressed:: bind -k ppage history-search-backward -Turn on Vi key bindings and rebind :kbd:`Control`\ +\ :kbd:`C` to clear the input line:: +Turn on :ref:`Vi key bindings ` and rebind :kbd:`Control`\ +\ :kbd:`C` to clear the input line:: set -g fish_key_bindings fish_vi_key_bindings bind -M insert \cc kill-whole-line repaint diff --git a/doc_src/interactive.rst b/doc_src/interactive.rst index 1aec76b64..ff381f29e 100644 --- a/doc_src/interactive.rst +++ b/doc_src/interactive.rst @@ -153,7 +153,7 @@ Command line editor The fish editor features copy and paste, a `searchable history <#history-search>`_ and many editor functions that can be bound to special keyboard shortcuts. -Similar to bash, fish has Emacs and Vi editing modes. The default editing mode is Emacs. You can switch to Vi mode with ``fish_vi_key_bindings`` and switch back with ``fish_default_key_bindings``. You can also make your own key bindings by creating a function and setting $fish_key_bindings to its name. For example:: +Like bash and other shells, fish includes two sets of keyboard shortcuts (or key bindings): one inspired by the Emacs text editor, and one by the Vi text editor. The default editing mode is Emacs. You can switch to Vi mode by running ``fish_vi_key_bindings`` and switch back with ``fish_default_key_bindings``. You can also make your own key bindings by creating a function and setting the ``fish_key_bindings`` variable to its name. For example:: function fish_hybrid_key_bindings --description \ @@ -165,13 +165,14 @@ Similar to bash, fish has Emacs and Vi editing modes. The default editing mode i end set -g fish_key_bindings fish_hybrid_key_bindings +While the key bindings included with fish include many of the shortcuts popular from the respective text editors, they are not a complete implementation. They include a shortcut to open the current command line in your preferred editor (:kbd:`Alt`\ +\ :kbd:`E` by default) if you need the full power of your editor. .. _shared-binds: Shared bindings --------------- -Some bindings are shared between emacs- and vi-mode because they aren't text editing bindings or because what Vi/Vim does for a particular key doesn't make sense for a shell. +Some bindings are common across Emacs and Vi mode, because they aren't text editing bindings, or because what Vi/Vim does for a particular key doesn't make sense for a shell. - :kbd:`Tab` `completes <#tab-completion>`_ the current token. :kbd:`Shift`\ +\ :kbd:`Tab` completes the current token and starts the pager's search mode. diff --git a/doc_src/language.rst b/doc_src/language.rst index d1bb2b2cb..8df586968 100644 --- a/doc_src/language.rst +++ b/doc_src/language.rst @@ -1212,6 +1212,8 @@ You can change the settings of fish by changing the values of certain variables. empty string, history is not saved to disk (but is still available within the interactive session). +- ``fish_key_bindings``, the name of the function that sets up the keyboard shortcuts for the :ref:`command-line editor `. + - ``fish_trace``, if set and not empty, will cause fish to print commands before they execute, similar to ``set -x`` in bash. The trace is printed to the path given by the :ref:`--debug-output ` option to fish (stderr by default). - ``fish_user_paths``, a list of directories that are prepended to ``PATH``. This can be a universal variable.