Our great sponsors
-
null-ls.nvim
Discontinued Use Neovim as a language server to inject LSP diagnostics, code actions, and more via Lua.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
However you can see that it would be quite cool to allow simple binaries like black or eslint to hook into the lsp and allow us to run formatting as if they were an lsp server. This is precisely why null-ls exists. Null-ls allows your simple binaries to hook into lsp features allowing you to interact with the binaries as you would normally like vim.lsp.buf.format() for example.
I use null-ls (https://github.com/jose-elias-alvarez/null-ls.nvim), I haven't tried it for python, but haven't had trouble with lua, js, ts or rust. You can also look into formatter.nvim (https://github.com/mhartington/formatter.nvim).
Do yourself a favor, forget everything else and just use black+ruff https://github.com/charliermarsh/ruff
There is a fundamental difference between formatters and lsp. Lsp-zero just set's up lsp. Lsp is the language server protocol, so lsp-zero only setus up things you get from your lsp server, in python's case perhaps pyright. So formatting will only work if your language server supports it, hence why it's working for you in c and c++ files. In c and c++, clangd supports formatting, however in python's case and pyright it doesn't.