feat(nvim): enable plugins for pylsp

This commit is contained in:
matt1432 2025-05-10 12:59:30 -04:00
parent 891ba58074
commit 025bb83e50

View file

@ -9,11 +9,18 @@
cfg = config.programs.neovim;
# We keep the packages here because python is a bit complicated and common
pythonPkgs = py:
pythonPkgs = p:
(attrValues {
inherit (py) python-lsp-server;
inherit
(p)
python-lsp-server
pyls-isort
pylsp-mypy
python-lsp-ruff
python-lsp-jsonrpc
;
})
++ py.python-lsp-server.optional-dependencies.all;
++ p.python-lsp-server.optional-dependencies.all;
in {
config = mkIf (cfg.enable && cfg.ideConfig.enablePython) {
programs = {
@ -32,8 +39,26 @@ in {
settings = {
pylsp = {
plugins = {
pycodestyle = {
maxLineLength = 100,
-- auto-completion options
jedi_completion = {
fuzzy = true,
},
-- import sorting
pyls_isort = {
enabled = true,
},
-- type checker
pylsp_mypy = {
enabled = true,
},
-- linter
ruff = {
enabled = true,
formatEnabled = true,
lineLength = 100,
},
},
},