Neovim LSP
:help lsp
Python
pyls_ms
- Install .NET Core.
- Install lspconfig by adding the following to the
init.vim
Plug 'neovim/nvim-lspconfig'
- run
:LspInstall pyls_ms
pyls
See also https://jdhao.github.io/2019/11/20/neovim_builtin_lsp_hands_on/#fn:1
First, install the pyls
pip install 'python-language-server'
pip install pyls-mypy pyls-isort pyls-black
add and install
Plug 'neovim/nvim-lspconfig' Plug 'nvim-lua/completion-nvim' Plug 'nvim-lua/diagnostic-nvim'
lua << EOF local nvim_lsp = require'lspconfig' local custom_lsp_attach = function(client) vim.api.nvim_buf_set_keymap(0, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', {noremap = true}) vim.api.nvim_buf_set_keymap(0, 'n', '<c-]>', '<cmd>lua vim.lsp.buf.definition()<CR>', {noremap = true}) vim.api.nvim_buf_set_keymap(0, 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', {noremap = true}) vim.api.nvim_buf_set_option(0, 'omnifunc', 'v:lua.vim.lsp.omnifunc') require('completion').on_attach(client) end nvim_lsp.pyls.setup({ plugins = { black = {enabled = true}, isort = {enabled = true}, mypy = {enabled = true}, }, on_attach=custom_lsp_attach }) EOF