From: Samir Benmendil Date: Sat, 20 Jan 2024 17:29:56 +0000 (+0000) Subject: nvim: move settings from lsp to lang/python X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/f6f762b6ab4a27d8102a86fc7a700a233fb3bf61 nvim: move settings from lsp to lang/python --- diff --git a/nvim/lua/plugins/lang/python.lua b/nvim/lua/plugins/lang/python.lua index 537d032..aee4474 100644 --- a/nvim/lua/plugins/lang/python.lua +++ b/nvim/lua/plugins/lang/python.lua @@ -14,6 +14,9 @@ return { servers = { pyright = {}, ruff_lsp = { + root_dir = function(fname) + return require("lspconfig.util").root_pattern("pyproject.toml", "setup.cfg", "ruff.toml")(fname) + end, keys = { { "co", @@ -30,6 +33,20 @@ return { }, }, }, + pylsp = { + settings = { + pylsp = { + plugins = { + autopep8 = { enabled = false }, + flake8 = { enabled = false }, + mccabe = { enabled = false }, + pycodestyle = { enabled = false }, + pydocstyle = { enabled = false }, + pyflakes = { enabled = false }, -- covered by flake8 + } + } + } + } }, setup = { ruff_lsp = function() diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index 3354f7d..509841c 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -28,25 +28,6 @@ return { }, -- Add clangd extensions -- https://github.com/p00f/clangd_extensions.nvim - ruff_lsp = { - root_dir = function(fname) - return require("lspconfig.util").root_pattern("pyproject.toml", "setup.cfg", "ruff.toml")(fname) - end, - }, - pylsp = { - settings = { - pylsp = { - plugins = { - autopep8 = { enabled = false }, - flake8 = { enabled = false }, - mccabe = { enabled = false }, - pycodestyle = { enabled = false }, - pydocstyle = { enabled = false }, - pyflakes = { enabled = false }, -- covered by flake8 - } - } - } - } }, -- you can do any additional lsp server setup here -- return true if you don't want this server to be setup with lspconfig