Fix partial merge of last doc update
Just cherry picked the last commit in the previous PR and noticed that I have just got part of the changes due to multiple commits in the PR. However as I did already push I am now providing the missing changes manually rather than to rollback the commit.
This commit is contained in:
parent
16e36d75e1
commit
b00767cd6e
|
@ -1081,15 +1081,24 @@ for that matter. For example, ~SPC a~ points to key bindings for “applications
|
|||
like ~SPC a c~ for =calc-dispatch=. Nesting bindings is easy.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(spacemacs/declare-prefix "]" "bracket-prefix")
|
||||
(spacemacs/set-leader-keys "]]" 'double-bracket-command)
|
||||
(spacemacs/declare-prefix "o" "custom")
|
||||
(spacemacs/set-leader-keys "oc" 'my-custom-command)
|
||||
#+END_SRC
|
||||
|
||||
The first line declares ~SPC ]~ to be a prefix and the second binds the key
|
||||
sequence ~SPC ]]~ to the corresponding command. The first line is actually
|
||||
The first line declares ~SPC o~ to be a prefix and the second binds the key
|
||||
sequence ~SPC oc~ to the corresponding command. The first line is actually
|
||||
unnecessary to create the prefix, but it will give your new prefix a name that
|
||||
key-discovery tools can use (e.g., which-key).
|
||||
|
||||
Example to create binding in major mode:
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(spacemacs/declare-prefix-for-mode 'org-mode "o" "custom")
|
||||
(spacemacs/set-leader-keys-for-major-mode 'org-mode "oi" 'org-id-get-create)
|
||||
#+end_src
|
||||
|
||||
This would add binding as ~, oi~ and ~SPC moi~.
|
||||
|
||||
There is much more to say about bindings keys, but these are the basics. Keys
|
||||
can be bound in your =~/.spacemacs= file or in individual layers.
|
||||
|
||||
|
|
Loading…
Reference in New Issue