feat: add python formatting

This commit is contained in:
anth64 committed 2026-11-15 10:18:02 +01:00
1 parent e71b388358
commit 4724eb8dd5
3 files changed
+7 -1

No files matched your search

+1
View File
@@ -22,3 +22,4 @@ Language servers and formatters, per language:
- JavaScript/TypeScript: typescript (7+, uses `tsc --lsp`) - JavaScript/TypeScript: typescript (7+, uses `tsc --lsp`)
- HTML/CSS/JSON: vscode-langservers-extracted - HTML/CSS/JSON: vscode-langservers-extracted
- Lua: lua-language-server - Lua: lua-language-server
- Python: basedpyright, ruff
+5
View File
@@ -0,0 +1,5 @@
local format = require("plugins/vis-plug").plugins.format
return format.stdio_formatter(function(win)
return "ruff format" .. format.with_filename(win, " --stdin-filename ") .. " -"
end)
+1 -1
View File
@@ -47,7 +47,7 @@ for _, syntax in ipairs(servers) do
ls_map[syntax] = require("lsp/" .. syntax) ls_map[syntax] = require("lsp/" .. syntax)
end end
local formatters = { "ansi_c", "cpp", "csharp" } local formatters = { "ansi_c", "cpp", "csharp", "python" }
local format = plug.plugins.format local format = plug.plugins.format
local on_save_syntaxes = {} local on_save_syntaxes = {}
for _, syntax in ipairs(formatters) do for _, syntax in ipairs(formatters) do