aboutsummaryrefslogtreecommitdiff
path: root/doc/source
diff options
context:
space:
mode:
authorEivind Fonn <evfonn@gmail.com>2019-12-21 16:26:52 +0100
committerEivind Fonn <evfonn@gmail.com>2019-12-21 16:26:52 +0100
commita28f0147aabf211442dea1283e8cd31f05d2b8cb (patch)
tree93a3a67973eb03bfe4345174771367956a7eab2b /doc/source
parent241c7a6c996c3c19f8f7f885ab8d087f0e5fc565 (diff)
Document leader key functionality
Diffstat (limited to 'doc/source')
-rw-r--r--doc/source/keymaps.rst20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/source/keymaps.rst b/doc/source/keymaps.rst
index c1babad..2e9e4a4 100644
--- a/doc/source/keymaps.rst
+++ b/doc/source/keymaps.rst
@@ -123,3 +123,23 @@ bindings are desired:
.. code-block:: elisp
(add-hook 'text-mode-hook 'foo-mode) ; enable alongside text-mode
+
+
+Leader keys
+-----------
+
+Evil supports a simple implementation of Vim's *leader* keys. To bind
+a function to a leader key you can use the expression ``<leader>`` in
+a key mapping, e.g.
+
+.. code-block:: elisp
+
+ (evil-define-key 'normal 'global (kbd "<leader>fs") 'save-buffer)
+
+Likewise, you can use the expression ``<localleader>`` to mimic Vim's
+local leader, which is designed for mode-specific key bindings.
+
+You can use the function :elisp:ref:`evil-set-leader` to designate
+which function as the leader and the local leader.
+
+.. elisp:autofunction:: evil-set-leader