diff options
| author | Reiner Herrmann <reiner@reiner-h.de> | 2023-11-02 19:16:51 +0100 |
|---|---|---|
| committer | Reiner Herrmann <reiner@reiner-h.de> | 2023-11-02 19:16:51 +0100 |
| commit | b193e74556f23c26fca8963e974863a7b9e19227 (patch) | |
| tree | 05167d07eda50dae356c9bdb86f2a35642fc7a8f /vimrc | |
| parent | 0759d6eec05ea50ec1a33a97c7a36ae39fe288bc (diff) | |
vim: replace vim-lsc with lsp
vim-lsc development seems to stagnate, and lsp seems to be already
more feature-rich.
lsp requires vim9, but this is available in current Debian stable.
Diffstat (limited to 'vimrc')
| -rw-r--r-- | vimrc | 51 |
1 files changed, 31 insertions, 20 deletions
@@ -144,25 +144,36 @@ let g:bufExplorerShowNoName=1 let g:airline#extensions#whitespace#enabled=0 let g:airline#extensions#tabline#enabled=1 -" LSC settings -let g:lsc_auto_map=v:true -let g:lsc_auto_map={'defaults': v:true, 'NextReference':'', 'PreviousReference':''} -let g:lsc_server_commands= - \ { 'rust': { - \ 'command': 'rust-analyzer', - \ 'log_level': -1, - \ 'suppress_stderr': v:true - \ }, - \ 'c': { - \ 'command': ['ccls', '--init={"cache":{"directory":"' . $HOME . '/.cache/ccls-cache"}}'], - \ 'log_level': -1, - \ 'suppress_stderr': v:true - \ }, - \ 'cpp': { - \ 'command': ['ccls', '--init={"cache":{"directory":"' . $HOME . '/.cache/ccls-cache"}}'], - \ 'log_level': -1, - \ 'suppress_stderr': v:true - \ } - \ } +" LSP settings +packadd lsp +call LspOptionsSet(#{ + \ autoHighlight: v:true, + \ showDiagOnStatusLine: v:true, + \ showDiagWithVirtualText: v:true, + \ usePopupInCodeAction: v:true, + \ }) +call LspAddServer([#{ + \ name: 'clangd', + \ filetype: ['c', 'cpp'], + \ path: 'clangd', + \ args: ['--background-index'] + \ }]) +call LspAddServer([#{ + \ name: 'rust-analyzer', + \ filetype: ['rust'], + \ path: 'rust-analyzer', + \ args: [], + \ syncInit: v:true, + \ initializationOptions: #{ + \ inlayHints: #{ + \ typeHints: #{ + \ enable: v:true + \ }, + \ parameterHints: #{ + \ enable: v:true + \ } + \ }, + \ } + \ }]) " vim: set et:sw=4:sts=4 |
