Improve imenu-list keybinding to account for LSP

This commit is contained in:
Jeremy Dormitzer 2020-02-12 14:25:06 -05:00
parent a37042591c
commit 5073e63798

View File

@ -4859,7 +4859,15 @@ Get a nice IMenu sidebar:
(imenu-list-major-mode-map "SPC" leader-map)
(imenu-list-major-mode-map "." #'imenu-list-display-entry))
(leader-def-key "\\" #'imenu-list-smart-toggle)
(defun open-imenu-list ()
(interactive)
(if (and (fboundp 'lsp-ui-imenu)
(boundp 'lsp-mode)
lsp-mode)
(lsp-ui-imenu)
(imenu-list-smart-toggle)))
(leader-def-key "\\" #'open-imenu-list)
(leader-def-key "m" #'imenu)
#+END_SRC