tools/lsp: lazy load <leader> c l keybind

Fixes a issue where folks would try to rebind <leader> c, only to get a
non-prefix key error about <leader> c l.
This commit is contained in:
Henrik Lissner 2020-08-27 17:44:58 -04:00
parent 362f101227
commit 841eacc77d
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
4 changed files with 51 additions and 39 deletions

View file

@ -0,0 +1,20 @@
;;; config/default/autoload/deferred.el -*- lexical-binding: t; -*-
;; TODO generalize this
;;;###autoload
(defun +default/lsp-command-map ()
"Lazily invoke `lsp-command-map'."
(interactive)
(require 'lsp-mode)
(map! :leader "c l" lsp-command-map)
(dolist (leader-key (list doom-leader-key doom-leader-alt-key))
(let ((lsp-keymap-prefix (concat leader-key " c l")))
(lsp-enable-which-key-integration)))
(setq prefix-arg current-prefix-arg
unread-command-events
(mapcar (lambda (e) (cons t e))
(vconcat (when evil-this-operator
(where-is-internal evil-this-operator
evil-normal-state-map
t))
(this-command-keys)))))