spacemacs/core
thanhvg e3b6464649
[core][tide][lsp] improve spacemacs/set-leader-keys-for-minor-mode and apply it to tide and lsp layers (#14141)
* [core][keybinng] improve minor mode binding

This commit added add a new function defun spacemacs/declare-prefix-for-minor-mode
and improved spacemacs/set-leader-keys-for-minor-mode.

`which-key` package recently introduced a new api
which-key-add-keymap-based-replacements which improves perfomance and allows
prefix and namings to be stored directly in keymap. This is a great improvement.

With this new api we now make change to spacemacs/declare-prefix-for-minor-mode
to manage prefix also. For example:

  (spacemacs/set-leader-keys-for-minor-mode 'lsp-mode
    "=" "format"
    "=b" #'lsp-format-buffer)

Before we had to use another api to bind prefix
spacemacs/declare-prefix-for-mode which only works on major-mode. As lsp-mode is
a minor mode this api causes a lot of problems to which-key performance. An
example is https://github.com/syl20bnr/spacemacs/issues/12455 which led to my
hack in https://github.com/syl20bnr/spacemacs/pull/12474.

The improved spacemacs/set-leader-keys-for-minor-mode will take care of both
prefix and key naming for the minor mode. This will allows us to have a better
set up for dynamic minor modes such as lsp-mode, tide-mode etc.

Also another api is created to make prefix for minor mode:
spacemacs/declare-prefix-for-minor-mode.

Usage:
(spacemacs/declare-prefix-for-minor-mode 'tide-mode "E" "errors")"

* [tide] improve prefix

* [lsp] improve prefix
2020-11-21 07:34:55 +01:00
..
aprilfool update copyright to 2020 2020-09-23 21:25:01 +02:00
banners Fix home buffer version and banner 2019-12-03 20:44:22 +00:00
gnupg [core] Update spacemacs GPG public key 2019-08-23 12:39:22 -04:00
info
libs [core] Add spinner.el from Artur Malabarba to libs 2020-09-21 01:12:41 -04:00
templates Add persistent-scratch and unkillable-scratch into core/spacemacs-editing layer (#14115) 2020-11-14 10:02:51 +01:00
core-command-line.el update copyright to 2020 2020-09-23 21:25:01 +02:00
core-configuration-layer.el Fix misc. compilation warnings 2020-10-15 23:49:33 +02:00
core-custom-settings.el update copyright to 2020 2020-09-23 21:25:01 +02:00
core-debug.el update copyright to 2020 2020-09-23 21:25:01 +02:00
core-display-init.el update copyright to 2020 2020-09-23 21:25:01 +02:00
core-documentation.el update copyright to 2020 2020-09-23 21:25:01 +02:00
core-dotspacemacs.el Add persistent-scratch and unkillable-scratch into core/spacemacs-editing layer (#14115) 2020-11-14 10:02:51 +01:00
core-dumper.el update copyright to 2020 2020-09-23 21:25:01 +02:00
core-emacs-backports.el update copyright to 2020 2020-09-23 21:25:01 +02:00
core-env.el Fix misc. compilation warnings 2020-10-15 23:49:33 +02:00
core-fonts-support.el update copyright to 2020 2020-09-23 21:25:01 +02:00
core-funcs.el Fix misc. compilation warnings 2020-10-15 23:49:33 +02:00
core-hooks.el update copyright to 2020 2020-09-23 21:25:01 +02:00
core-jump.el update copyright to 2020 2020-09-23 21:25:01 +02:00
core-keybindings.el [core][tide][lsp] improve spacemacs/set-leader-keys-for-minor-mode and apply it to tide and lsp layers (#14141) 2020-11-21 07:34:55 +01:00
core-load-paths.el update copyright to 2020 2020-09-23 21:25:01 +02:00
core-micro-state.el update copyright to 2020 2020-09-23 21:25:01 +02:00
core-progress-bar.el update copyright to 2020 2020-09-23 21:25:01 +02:00
core-release-management.el update copyright to 2020 2020-09-23 21:25:01 +02:00
core-spacebind.el fix spacebind prefixing bug 2020-10-08 09:35:40 +03:00
core-spacemacs-buffer.el fixes the wrong display of Release Notes 2020-10-10 04:08:34 +02:00
core-spacemacs.el Add spacemacs-scratch-mode-hook 2020-10-23 18:34:25 +02:00
core-themes-support.el update copyright to 2020 2020-09-23 21:25:01 +02:00
core-toggle.el update copyright to 2020 2020-09-23 21:25:01 +02:00
core-transient-state.el update copyright to 2020 2020-09-23 21:25:01 +02:00
core-use-package-ext.el update copyright to 2020 2020-09-23 21:25:01 +02:00
core-versions.el update copyright to 2020 2020-09-23 21:25:01 +02:00