New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot change lsp-keymap-prefix with setq #1532
Comments
(use-package lsp-mode
:ensure t
:defer t
:hook (lsp-mode . (lambda ()
(let ((lsp-keymap-prefix "C-c l"))
(lsp-enable-which-key-integration))))
:init
(setq lsp-keep-workspace-alive nil
lsp-signature-doc-lines 5
lsp-idle-delay 0.5
lsp-prefer-capf t
lsp-client-packages nil)
:config
(define-key lsp-mode-map (kbd "C-c l") lsp-command-map)) |
You may use @kiennq suggestion or move |
@tjtrabue , you can also use :bind-keymap ("s-SPC" . lsp-command-map)
:bind (:map lsp-mode-map
("s-r" . lsp-rename)) |
Since C-c l involves three keys, and my keyboard(thinkpad X1E) has a special key: Fn. |
Hey everyone! I hope I'm not terribly off-base here. This is my first time reporting a bug on GitHub. First of all, let me say that I love lsp-mode! It's fantastic. Great job, everyone. This is an incredible technical accomplishment.
Describe the bug
When I use
(setq lsp-keymap-prefix "C-c l")
to change the prefix for executing lsp-mode commands, I cannot use my new keymap. When I checkC-h v
to view the value oflsp-keymap-prefix
I see that it is indeed my new keybinding "C-c l", but again, this new keybinding does nothing when I attempt to use it. In fact, Emac's echo area reports "C-c l is undefined".I do have a workaround. Using
(define-key lsp-mode-map (kbd "C-c l") lsp-command-map)
does work. I got the idea from projectile's documentation detailing how to map their prefix sequence. Any idea why this method works for me while the official method seems to do nothing?Thank you so much!
To Reproduce
init.el
file:Open any file supported by a language server and client within lsp-mode (I used a Bash file with bash-language-server)
Attempt to use the new keymapping "C-c l" to issue an LSP command.
Expected behavior
I expect to see a prompt for an LSP command appear in the echo area. However, I get "C-c l is undefined".
Which Language Server did you use
bash-language-server
OS
Arch Linux. Kernel version: 5.4.26-1-lts
Emacs version 28.0.50
Error callstack
The only error I get is that "C-c l is undefined." The lsp-mode functions appear to work just fine when I call them using
M-x <function-name>
. It's only the keymap that isn't working properly.The text was updated successfully, but these errors were encountered: