summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReiner Herrmann <reiner@reiner-h.de>2023-11-02 19:24:02 +0100
committerReiner Herrmann <reiner@reiner-h.de>2023-11-02 19:24:02 +0100
commitf5726db8b66264dc3888050cf66c32ebbad1eff8 (patch)
tree586ddd1cafc376e573fc80c027fc058dedcc362a
parentb193e74556f23c26fca8963e974863a7b9e19227 (diff)
vim: add LSP servers only if lsp binaries are available
-rw-r--r--vimrc6
1 files changed, 6 insertions, 0 deletions
diff --git a/vimrc b/vimrc
index 2459891..64d94b4 100644
--- a/vimrc
+++ b/vimrc
@@ -152,12 +152,17 @@ call LspOptionsSet(#{
\ showDiagWithVirtualText: v:true,
\ usePopupInCodeAction: v:true,
\ })
+
+if executable("clangd")
call LspAddServer([#{
\ name: 'clangd',
\ filetype: ['c', 'cpp'],
\ path: 'clangd',
\ args: ['--background-index']
\ }])
+endif
+
+if executable("rust-analyzer")
call LspAddServer([#{
\ name: 'rust-analyzer',
\ filetype: ['rust'],
@@ -175,5 +180,6 @@ call LspAddServer([#{
\ },
\ }
\ }])
+endif
" vim: set et:sw=4:sts=4