vim: add lsp

This commit is contained in:
Marco Thomas
2023-06-12 00:31:17 +02:00
parent a79fbc4090
commit c14ee9dc08

View File

@@ -24,6 +24,11 @@ Plug 'sainnhe/everforest' " color scheme
Plug 'vim-airline/vim-airline' " a nicer status line
Plug 'vim-airline/vim-airline-themes' " auto settings theme for airline
Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next',
\ 'do': 'bash install.sh',
\ }
call plug#end()
" ============================== Colors
syntax on
@@ -124,3 +129,18 @@ fun! TrimWhitespace()
call winrestview(l:save)
endfun
noremap <leader>ws :call TrimWhitespace()<CR>
map <C-M> :messages<CR>
" ============================== LSP
set hidden
let g:LanguageClient_serverCommands = {
\ 'rust': ['~/.cargo/bin/rust-analyzer'],
\ 'python': ['/usr/bin/pylsp'],
\ 'c': ['/usr/bin/clang'],
\ 'cpp': ['/usr/bin/clangd'],
\ }
nnoremap <C-l> :call LanguageClient_contextMenu()<CR>
map <F2> :call LanguageClient#textDocument_rename()<CR>
map <F12> :call LanguageClient#textDocument_definition()<CR>