diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-10-27 11:10:29 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-10-27 11:11:04 +0100 |
commit | 3837596e546ec321565628ce2fb5a4cddc529ecd (patch) | |
tree | 7b1ebd61eaf0e11ae0ab8cfbac13e333bde39214 /dotvimrc | |
parent | 8af69345adef52b55a282247e31197ffb05dacef (diff) | |
download | vimrc-3837596e546ec321565628ce2fb5a4cddc529ecd.tar.gz vimrc-3837596e546ec321565628ce2fb5a4cddc529ecd.tar.bz2 vimrc-3837596e546ec321565628ce2fb5a4cddc529ecd.zip |
Add LanguageServer
Diffstat (limited to 'dotvimrc')
-rw-r--r-- | dotvimrc | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -14,7 +14,7 @@ set wildmode=longest:full set wildmenu set hlsearch set pastetoggle=<F10> -set tw=0 +set textwidth=120 set backspace=eol,indent,start set number "set mouse=a "Disabled @@ -59,6 +59,24 @@ let mapleader="\<Space>" "nnoremap <leader>sr :SourcetrailRefresh<CR> "nnoremap <leader>sa :SourcetrailActivateToken<CR> +set runtimepath+=~/.vim/LanguageClient-neovim +" Required for operations modifying multiple buffers like rename. + +let g:LanguageClient_serverCommands = { + \ 'rust': ['rust-analyzer'], + \ 'python': ['pyls'], + \ 'cpp': ['clangd'], + \ 'c': ['clangd'] } + +let g:LanguageClient_useVirtualText = "No" +let g:LanguageClient_autoStart = 0 + +nnoremap <F8> :call LanguageClient_contextMenu()<CR> +nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR> +nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR> + +set completefunc=LanguageClient#complete + if executable('rg') let g:ackprg = "rg -i --vimgrep" let g:ack_default_options = " -i --vimgrep" @@ -97,6 +115,7 @@ noremap <Leader>F :YcmCompleter FixIt<CR>:ccl<CR> "rust-lang/rust.vim let g:rust_recommended_style = 0 au FileType rust nmap <Leader>m :make build<CR> +au FileType rust nmap <Leader>c :Cargo check<CR> "tpope/vim-surround.git "taglist.vim @@ -190,6 +209,9 @@ autocmd BufNewFile,BufRead *.s set filetype=armasm "Markdown, not modula2 autocmd BufNewFile,BufRead *.md set filetype=markdown +autocmd BufNewFile,BufRead *.toml set filetype=dosini +autocmd BufNewFile,BufRead *.j2 set filetype=jinja + set nostartofline "Leader-f switches from C source .c to header .h file |