Add lsp-command-map to SPC-c-l

The default lsp-mode bindings are bound to `s-l` which is impractical
for anyone using keybindings in their window manager. It also conflicts
w/ the doom approach of using leader keys. This change makes
all the default lsp bindings (see
https://github.com/emacs-lsp/lsp-mode#commands) available on SPC-c-l.

So for example, restarting the lsp server can be done with `SPC c l s r`.
This commit is contained in:
James Ravn 2020-04-21 20:24:13 +01:00
parent 0a26a22d59
commit c56afcfe01
No known key found for this signature in database
GPG key ID: 52C372C72159D6EE
3 changed files with 25 additions and 14 deletions

View file

@ -42,6 +42,8 @@ working on that project after closing the last buffer.")
(setq lsp-server-install-dir (concat doom-etc-dir "lsp/")
lsp-groovy-server-install-dir (concat lsp-server-install-dir "lsp-groovy/")
lsp-intelephense-storage-path (concat doom-cache-dir "lsp-intelephense/"))
;; Let doom bind the LSP keymap.
(setq lsp-keymap-prefix nil)
;; Disable LSP's superfluous, expensive and/or debatably unnecessary features.
;; Some servers implement these poorly. Better to just rely on Emacs' native
@ -114,6 +116,10 @@ This also logs the resolved project root, if found, so we know where we are."
(lambda (it) (format "[%s]" (lsp--workspace-print it)))
lsp--buffer-workspaces))))))
(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)))
(add-hook! 'lsp-mode-hook
(defun +lsp-init-company-h ()
(if (not (bound-and-true-p company-mode))