configure python

This commit is contained in:
Ray Elliott 2025-12-07 23:12:35 +00:00
commit b9d9f7e264
9 changed files with 96 additions and 12 deletions

View file

@ -95,8 +95,9 @@ return {
configure("intelephense", {
single_file_support = false,
})
configure("pyright") -- Python LSP
-- Enable all configured servers
vim.lsp.enable({ "lua_ls", "ts_ls", "html", "cssls", "jsonls", "bashls", "marksman", "intelephense" })
vim.lsp.enable({ "lua_ls", "ts_ls", "html", "cssls", "jsonls", "bashls", "marksman", "intelephense", "pyright" })
end,
}

View file

@ -13,6 +13,7 @@ return {
"bashls",
"marksman",
"intelephense",
"pyright",
},
automatic_installation = true,
})

View file

@ -10,11 +10,13 @@ return {
-- Formatters
"prettier", -- JS, TS, CSS, JSON, Markdown, HTML
"stylua", -- Lua
"black", -- Python
-- Note: phpcbf already installed globally
-- Linters
"eslint_d", -- JS, TS (daemon version for speed)
"markdownlint", -- Markdown
"ruff", -- Python (fast linter + import sorter)
-- Note: phpcs already installed globally
},
auto_update = false,

View file

@ -74,6 +74,11 @@ return {
formatting.stylua.with({
command = find_executable({ "stylua" }),
}),
-- black (Python)
formatting.black.with({
command = find_executable({ "black" }),
}),
},
-- Format on save

View file

@ -15,6 +15,7 @@ return {
typescriptreact = { "eslint_d" },
markdown = { "markdownlint" },
php = { "phpcs" },
python = { "ruff" },
}
-- Helper: Find project-local executable, fallback to global
@ -68,6 +69,9 @@ return {
-- Configure markdownlint
lint.linters.markdownlint.cmd = find_executable({ "markdownlint" }) or "markdownlint"
-- Configure ruff for Python
lint.linters.ruff.cmd = find_executable({ "ruff" }) or "ruff"
-- Auto-lint on these events
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {

View file

@ -26,6 +26,7 @@ return {
"markdown",
"markdown_inline",
"bash",
"python",
"regex",
},