add python variant

This commit is contained in:
Dietrich Rink
2023-06-10 15:25:00 +02:00
parent bd11cd4ed2
commit b3216433c4
3 changed files with 34 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
local lspconfig = require('lspconfig')
-- Get python executable from env
local python = vim.fn.globpath(vim.fn.getcwd(), "env/bin/python")
-- Set configuration
local config = {}
if python ~= '' then
config.cmd = { python, '-m', 'pylsp' }
end
-- Set up pylsp
lspconfig.pylsp.setup(config)