From 5073e6379866d6bedc3427df0bf54d3785d10068 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Wed, 12 Feb 2020 14:25:06 -0500 Subject: [PATCH] Improve imenu-list keybinding to account for LSP --- emacs/init.org | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/emacs/init.org b/emacs/init.org index e7c5f49..5258f18 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -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