Language Server Protocol (LSP) support for vim and neovim.
More recordings at Updates, screenshots & GIFs.
- Non-blocking asynchronous calls.
- Sensible completion. Integrated with deoplete or nvim-completion-manager. Or with
omnifunc
. - Realtime diagnostics/compiler/lint message.
- Rename.
- Hover/Get identifer info.
- Goto definition.
- Goto reference locations.
- Workspace/Document symbols query.
- Formatting.
- Code Action/Fix.
(Note: Most of the functionality are provided by language servers. Specific language servers may implement only a subset of the features, see http://langserver.org, in which case, featured listed above may not fully functional.)
Using vim-plug
:
Plug 'autozimu/LanguageClient-neovim', { \ 'branch': 'next', \ 'do': './install.sh' \ } " (Optional) Multi-entry selection UI. Plug 'junegunn/fzf' " (Completion plugin option 1) Plug 'roxma/nvim-completion-manager' " (Completion plugin option 2) Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Example configuration
" Required for operations modifying multiple buffers like rename. set hidden let g:LanguageClient_serverCommands = { \ 'rust': ['rustup', 'run', 'nightly', 'rls'], \ 'javascript': ['javascript-typescript-stdio'], \ } nnoremap <silent> K :call LanguageClient_textDocument_hover()<CR> nnoremap <silent> gd :call LanguageClient_textDocument_definition()<CR> nnoremap <silent> <F2> :call LanguageClient_textDocument_rename()<CR>
Run command nvim +PlugInstall +UpdateRemotePlugins +qa
in shell to install this plugin. Install corresponding language servers. Restart neovim/vim and language services will be available right away. Happy hacking!
Please see INSTALL for complete installation and configuration instructions.
Please see http://langserver.org and/or https://github.com/Microsoft/language-server-protocol/wiki/Protocol-Implementations.
See LanguageClient.txt for full list of configurations, commands and functions.
The MIT License.