if empty(glob('~/.vim/autoload/plug.vim')) silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim autocmd VimEnter * PlugInstall --sync | source $MYVIMRC endif call plug#begin('~/.vim/plugged') Plug 'Shougo/deoplete.nvim' Plug 'Shougo/deoplete-lsp' call plug#end() " If you use deoplete, remove comment out and comment out line 55. " let g:deoplete#enable_at_startup = 1 let g:language_server_client_log_level = 'debug' call lsp#add_server_config({ \ 'server_name': 'gopls', \ 'filetype': ['go'], \ 'cmd': 'gopls', \ 'server_config': {} \ }) call lsp#add_server_config({ \ 'server_name': 'rls', \ 'filetype': ['rust'], \ 'cmd': 'rls', \ 'capabilities': { \ 'clippy_preference': 'on', \ 'all_targets': v:false, \ 'build_on_save': v:true, \ 'wait_to_build': 0 \ }}) call lsp#add_server_config({ \ "server_name": "pyls", \ "filetype": "python", \ "cmd": "pyls" \ }) call lsp#add_server_config({ \ "server_name": "clangd", \ "filetype": ["c", "cpp"], \ "cmd": "clangd -background-index", \ "capabilities": { \ "offsetEncoding": ["utf-8", "utf-16"] \ } \ }) call lsp#add_server_config({ \ 'filetype': ['typescript', 'typescript.tsx'], \ 'cmd': ['npx', 'javascript-typescript-langserver'] \ }) call luaeval("vim.lsp.config.set_all_builtin_callbacks()") autocmd Filetype rust,python,go,c,cpp inoremap =lsp#text_document_completion() nnoremap ;lh :call lsp#text_document_hover() nnoremap ;ls :call lsp#text_document_signature_help() nnoremap ;lr :call lsp#text_document_references() nnoremap ;ldc :call lsp#text_document_declaration() nnoremap ;ldf :call lsp#text_document_definition() nnoremap ;ltd :call lsp#text_document_type_definition() nnoremap ;li :call lsp#text_document_implementation()