Skip to content
Piping edited this page Jul 29, 2018 · 10 revisions

Welcome to the LanguageClient-neovim wiki!

Right side has a list of configurable components.
To enable the language client IDE features in vim, you need

  1. a language server for your language.
  2. various vim plugins like code completion plugin and key mappings for different functionalities.

Before using of LanguageClient, it is necessary to specify commands that are going to be used to start language server. See |LanguageClient_serverCommands| for detail. Here is a simple example config: >

let g:LanguageClient_serverCommands = {
    \ 'rust': ['rustup', 'run', 'nightly', 'rls'],
    \ }

After that, open a file with one of the above filetypes, functionalities provided by language servers should be available out of the box.

At this point, call any provided function as you like. See |LanguageClientFunctions| for a complete list of functions. Usually one would like to map these functions to shortcuts, for example: >

nnoremap <silent> K :call LanguageClient#textDocument_hover()<CR>
nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>

If one is using deoplete/nvim-completion-manager at the same time, completion should work out of the box. Otherwise, completion is available with 'C-X C-O' ('omnifunc').

Alternatively, set 'completefunc': > set completefunc=LanguageClient#complete < If the language server supports, diagnostic/lint information will be displayed via gutter and syntax highlighting with real time editing. At the same time, those info are populated into quickfix list (or location list), which can be accessed by regular quickfix/location list operations.

To use the language server with Vim's formatting operator |gq|, set 'formatexpr': > set formatexpr=LanguageClient#textDocument_rangeFormatting_sync() <

Clone this wiki locally