diff options
| -rw-r--r-- | vimrc | 70 |
1 files changed, 36 insertions, 34 deletions
@@ -146,40 +146,42 @@ let g:airline#extensions#tabline#enabled=1 " LSP settings packadd lsp -call LspOptionsSet(#{ - \ autoHighlight: v:true, - \ showDiagOnStatusLine: v:true, - \ 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'], - \ path: 'rust-analyzer', - \ args: [], - \ syncInit: v:true, - \ initializationOptions: #{ - \ inlayHints: #{ - \ typeHints: #{ - \ enable: v:true - \ }, - \ parameterHints: #{ - \ enable: v:true - \ } - \ }, - \ } - \ }]) +if exists("g:loaded_lsp") + call LspOptionsSet(#{ + \ autoHighlight: v:true, + \ showDiagOnStatusLine: v:true, + \ 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'], + \ path: 'rust-analyzer', + \ args: [], + \ syncInit: v:true, + \ initializationOptions: #{ + \ inlayHints: #{ + \ typeHints: #{ + \ enable: v:true + \ }, + \ parameterHints: #{ + \ enable: v:true + \ } + \ }, + \ } + \ }]) + endif endif " vim: set et:sw=4:sts=4 |
