Update the FAQ for evil-leader rebinding
As `SPC L` has moved to `SPC l` and avy is now on `SPC y`, the FAQ has to be updated because the evil-leader example doesn't make sense any longer. The question is also moved to "How do I …" where it belongs. The code has also been updated to be a little bit cleaner.
This commit is contained in:
parent
91c00fe76a
commit
05a2256cff
38
doc/FAQ.org
38
doc/FAQ.org
|
@ -10,7 +10,6 @@
|
|||
- [[The powerline separators have no anti-aliasing, what can I do?][The powerline separators have no anti-aliasing, what can I do?]]
|
||||
- [[Why is after-init-hook not executed?][Why is after-init-hook not executed?]]
|
||||
- [[What is the difference between =spacemacs-base= and =spacemacs= distributions?][What is the difference between =spacemacs-base= and =spacemacs= distributions?]]
|
||||
- [[How can I change or define an alias for an =evil-leader= prefix?][How can I change or define an alias for an =evil-leader= prefix?]]
|
||||
- [[Should I place my settings in =user-init= or =user-config=?][Should I place my settings in =user-init= or =user-config=?]]
|
||||
- [[Why do some of my =org=-related settings cause problems?][Why do some of my =org=-related settings cause problems?]]
|
||||
- [[Why is Spacemacs hanging on startup?][Why is Spacemacs hanging on startup?]]
|
||||
|
@ -23,6 +22,7 @@
|
|||
- [[Disable evilification of a mode?][Disable evilification of a mode?]]
|
||||
- [[Include underscores in word motions?][Include underscores in word motions?]]
|
||||
- [[Setup =$PATH=?][Setup =$PATH=?]]
|
||||
- [[Change or define an alias for an =evil-leader= prefix?][Change or define an alias for an =evil-leader= prefix?]]
|
||||
- [[Windows][Windows]]
|
||||
- [[Why do the fonts look crappy on Windows?][Why do the fonts look crappy on Windows?]]
|
||||
- [[Why is there no Spacemacs logo in the startup buffer?][Why is there no Spacemacs logo in the startup buffer?]]
|
||||
|
@ -71,18 +71,6 @@ Set the distribution with =dotspacemacs-distribution= variable. The default is
|
|||
check out the =packages.el= file in the respective folders in the
|
||||
=+distribution= folder of the =layers/= directory.
|
||||
|
||||
** How can I change or define an alias for an =evil-leader= prefix?
|
||||
It is possible to change an =evil-leader= prefix by binding its keymap to
|
||||
another sequence. For instance, if you want to switch ~SPC y~
|
||||
(=evil-avy-goto-line=) with ~SPC l~ (=perspectives= layer) to make the later
|
||||
easier to reach, you can use:
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(evil-leader/set-key
|
||||
"y" (lookup-key evil-leader--default-map "l")
|
||||
"l" 'evil-avy-goto-line)
|
||||
#+end_src
|
||||
|
||||
** Should I place my settings in =user-init= or =user-config=?
|
||||
Any variable that layer configuration code will *read* and *act on* must be set
|
||||
in =user-init=, and any variable that Spacemacs explicitly sets but you wish to
|
||||
|
@ -254,6 +242,30 @@ In that case you have the option of updating the value of =exec-path= in the
|
|||
(add-to-list 'exec-path "~/.local/bin/")
|
||||
#+END_SRC
|
||||
|
||||
** Change or define an alias for an =evil-leader= prefix?
|
||||
It is possible to change an =evil-leader= prefix by binding its keymap to
|
||||
another sequence. For instance, if you want to switch ~SPC S~ (spelling) with
|
||||
~SPC d~ (used by dash) to make the former easier to reach, you can use:
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(defun my-evil-leader/swap-keys (key1 key2)
|
||||
(let ((map1 (lookup-key evil-leader--default-map key1))
|
||||
(map2 (lookup-key evil-leader--default-map key2)))
|
||||
(evil-leader/set-key key1 map2 key2 map1)))
|
||||
(my-evil-leader/swap-keys "S" "d")
|
||||
#+end_src
|
||||
|
||||
If you want to define your own alias, like using ~SPC é~ (because it's an
|
||||
unmapped key on your keyboard-layout for instance) for accessing ~SPC w~
|
||||
(windows management), you can use this:
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(defun my-evil-leader/alias-of (key1 key2)
|
||||
(let ((map (lookup-key evil-leader--default-map key2)))
|
||||
(evil-leader/set-key key1 map)))
|
||||
(my-evil-leader/alias-of "é" "w")
|
||||
#+end_src
|
||||
|
||||
* Windows
|
||||
** Why do the fonts look crappy on Windows?
|
||||
You can install [[https://code.google.com/p/mactype/][MacType]] on Windows to get very nice looking fonts. It is
|
||||
|
|
Loading…
Reference in New Issue