Skip to content
mukund edited this page Oct 22, 2020 · 5 revisions

There are two options for setting up a language server with Python:

MPLS

Install MPLS from the repo: https://github.com/Microsoft/python-language-server

There are two AUR packages that can be found here: 1 2. I've found that the first one doesn't really work; the second one is better.

Add the following line to your .vimrc:

let g:LanguageClient_serverCommands = {
    'python' : ['dotnet', 'exec', '<path-to-mpls-installation>/Microsoft.Python.LanguageServer.dll'],
}

Next add the following to .vim/settings.json:

{
  "enabled": true,
  "initializationOptions": {
    "displayOptions": {
      "preferredFormat": "plaintext",
      "trimDocumentationLines": true,
      "maxDocumentationLineLength": 0,
      "trimDocumentationText": true,
      "maxDocumentationTextLength": 0
    },
    "interpreter": {
      "properties": {
        "InterpreterPath": "<path-to-python-executable>",
        "UseDefaultDatabase": true,
        "Version": "<python-version>"
      }
    }
  }
}

The entirety of the instructions here are obtained from this issue: https://github.com/autozimu/LanguageClient-neovim/issues/633

pyls

This section intentionally left blank as the author has no experience setting this up. If someone who has used pyls with this plugin can add the configuration here, that would be appreciated.

Clone this wiki locally