Skip to content

lsp-ui-peek-find-[definitions|references] keybindings get overridden by lsp-mode #702

Open
@aconchillo

Description

@aconchillo

Hi! I'm trying to keep lsp-ui-peek-find-definitions and lsp-ui-peek-find-references to the original bindings M-. and M-?.

I have the following code:

(use-package lsp-ui
  :ensure t
  :bind (([remap xref-find-definitions] . lsp-ui-peek-find-definitions)
         ([remap xref-find-references] . lsp-ui-peek-find-references))
  :config
  ;; Don't show sidelines
  (setq lsp-ui-sideline-enable nil))

And I have also tried the lsp-ui setup from here https://github.com/CSRaghunandan/.emacs.d/blob/master/setup-files/setup-lsp.el which uses

  (define-key lsp-ui-mode-map [remap xref-find-definitions] #'lsp-ui-peek-find-definitions)
  (define-key lsp-ui-mode-map [remap xref-find-references] #'lsp-ui-peek-find-references)

This seem to work outside of an LSP buffer (I can see those two functions have the right key binding). However, when I open the first LSP buffer (a JS one) the key bindings get changed to LSP default ones (s-l g g and s-l g r).

Is there a way keep the original key bindings?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions