Emacs: Use lsp-clangd-find-other-file when using clangd.

This commit is contained in:
tastytea 2021-02-08 23:07:16 +01:00
parent b69ee4c3aa
commit 1575b911e6
1 changed files with 8 additions and 2 deletions

View File

@ -37,7 +37,12 @@
(when (>= (my/clangd-version) 9.0)
(add-to-list 'lsp-clients-clangd-args "--clang-tidy" t))
;; Mark lsp-clients-clangd-args as safe to override.
(put 'lsp-clients-clangd-args 'safe-local-variable #'consp))
(put 'lsp-clients-clangd-args 'safe-local-variable #'consp)
(defun my/rebind-other-file-maybe ()
"Rebind C-: to LSP equivalent."
(when (equal major-mode 'c++-mode)
(bind-key "C-:" #'lsp-clangd-find-other-file 'c++-mode-map))))
:bind ("C-c C-f" . lsp-execute-code-action)
:hook ((c++-mode . lsp)
(c-mode . lsp)
@ -46,7 +51,8 @@
(json-mode . lsp)
(web-mode . lsp)
(css-mode . lsp)
(lsp-mode . lsp-enable-which-key-integration)))
(lsp-mode . lsp-enable-which-key-integration)
(lsp-mode . my/rebind-other-file-maybe)))
;; Eye-candy and flycheck support for lsp-mode.
(use-package lsp-ui