""" LanguageClient " Required for operations modifying multiple buffers like rename. set hidden " let g:LanguageClient_serverCommands = { " \ 'javascript': ['/usr/local/bin/javascript-typescript-stdio'], " \ 'javascript.jsx': ['tcp://127.0.0.1:2089'], " \ 'python': ['/usr/local/bin/pyls'], " \ 'ruby': ['~/.rbenv/shims/solargraph', 'stdio'], " \ } if !empty($RUST_VERSION) let g:LanguageClient_rustVersion = $RUST_VERSION else let g:LanguageClient_rustVersion = 'stable' endif let g:LanguageClient_serverCommands = { "\ 'rust': ['/usr/bin/rustup', 'run', g:LanguageClient_rustVersion, 'rust-analyzer'], \ 'rust': { \ 'name': 'rust-analyzer', \ 'command': ['/usr/bin/rustup', 'run', g:LanguageClient_rustVersion, 'rust-analyzer'], \ 'initializationOptions': { \ 'cargo': { \ 'features': 'true', \ } \ }, \ }, \ 'elixir': ['/usr/lib/elixir-ls/language_server.sh'], \ 'elm': ['/usr/bin/elm-language-server'], \ 'python': ['/usr/bin/pylsp'], \ 'go': ['/usr/bin/gopls'], \ 'promql': ['/usr/local/bin/promql-langserver'], \ 'java': ['/usr/bin/java-language-server'], \ 'typescript': ['/usr/bin/typescript-language-server', '--stdio'], \ 'typescriptreact': ['/usr/bin/typescript-language-server', '--stdio'], "\ 'Dockerfile': ['/usr/bin/docker-langserver', '--stdio'], \ 'hcl': ['/usr/bin/terraform-ls'], \ 'jsonnet': ['/usr/bin/jsonnet-language-server'], \ } let g:LanguageClient_rootMarkers = { \ 'elm': ['elm.json'], \ 'typescript': ['package.json'], \ 'typescriptreact': ['package.json'], \ 'rust': ['Cargo.toml'], \ 'python': ['pyproject.toml', 'setup.cfg'], \ 'jsonnet': ['jsonnetfile.json', 'jsonnetfile.lock.json'], \ } let g:LanguageClient_hoverPreview = 'always' function LC_maps() if has_key(g:LanguageClient_serverCommands, &filetype) nnoremap :call LanguageClient_contextMenu() nnoremap K :call LanguageClient#textDocument_hover() nnoremap gdd :call LanguageClient#textDocument_definition() nnoremap gdi :call LanguageClient#textDocument_implementation() nnoremap gdt :call LanguageClient#textDocument_typeDefinition() nnoremap gds :call LanguageClient#textDocument_documentSymbol() nnoremap gdr :call LanguageClient#textDocument_references() nnoremap :call LanguageClient#textDocument_rename() " noremap (lcn-menu) " noremap K (lcn-hover) " noremap gd (lcn-definition) " noremap (lcn-rename) let g:LanguageClient_loggingLevel = 'DEBUG' let g:LanguageClient_loggingFile = expand('~/.vim/LanguageClient.log') set formatexpr=LanguageClient#textDocument_rangeFormatting_sync() endif endfunction autocmd FileType * call LC_maps()