[Emacs] Fix shortcut issue with Spacemacs

This commit is contained in:
Lucien Cartier-Tilet 2020-08-30 18:45:08 +02:00
parent 8c6e622a7c
commit 1eb3833ad9
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -2816,9 +2816,9 @@
:END:
As you will see, I defined a LOT of custom keybindings. All of them are
Spacemacs keybindings, defined in a way they can be used seamlessly with
Evil. They all begin with ~o~, which is a prefix reserved for user-defined
keybindings so they wont conflict with any package. Lets declare it like
so.
Evil. They almost all begin with ~o~, which is a prefix reserved for
user-defined keybindings so they wont conflict with any package. Lets
declare it like so.
#+BEGIN_SRC emacs-lisp
(spacemacs/declare-prefix "o" "custom")
#+END_SRC
@ -2828,20 +2828,23 @@
followed by the sequence assigned to each keybinding.
Before some more specialized categories, I have two commands which dont fit
into any other category that I sometime use:
into any other category that I sometime use. The first one is a fix for the
Bépo keybindings which left out a keybind: ~winum-select-window-by-number~ is
still bound to ~SPC ²~, which is not a key that is available on the bépo
layout (instead, we use the dead key ~^~ followed by ~2~, or any digits). So
instead, lets use the key that is physically in the same place: ~$~.
#+BEGIN_SRC emacs-lisp
(spacemacs/declare-prefix "oB" "byte-compile ~/.config/emacs")
(spacemacs/declare-prefix "or" "external command")
(spacemacs/set-leader-keys
"oB" (lambda () (byte-recompile-directory (expand-file-name "~/.config/emacs") 0))
"or" 'helm-run-external-command)
(spacemacs/declare-prefix "$" "select window by number")
(spacemacs/set-leader-keys "$" 'winum-select-window-by-number)
#+END_SRC
~oB~ byte-compiles every ~.el~ file located in the =~/.config/emacs/=
directory — it can be useful in case of package upgrade and an old ~.elc~
file still loads instead of an uncompiled but newer ~.el~ file.
~or~ on the other hand invokes an external comand the same way [[https://wiki.archlinux.org/index.php/Dmenu][dmenu]] would.
The following, I use it rarely, it can launch an external command from Emacs
to launch, for instance, my web browser or any other software not related to
Emacs. It offers a similar interface to [[https://wiki.archlinux.org/index.php/Dmenu][dmenu]] through helm.
#+BEGIN_SRC emacs-lisp
(spacemacs/declare-prefix "or" "external command")
(spacemacs/set-leader-keys "or" 'helm-run-external-command)
#+END_SRC
*** Applications
:PROPERTIES: