Some Python Helix Language Server Configurations
Some Python Helix Language Server Configurations
November 2025
Getting Helix to play ’nicely’ with custom configuration wasn’t too
straightforward, specifically wanting ruff formatter to also do auto-fixes (e.g.
fixing imports). I also wanted the binaries to be managed by uvx rather than
polluting $PATH so needed a bit of customisation there as well.
Doing this ended up to be not too complicated, just need to find the correct setup.
On MacOS
1[[language]]
2name = "python"
3language-servers = ["pyrefly"]
4auto-formatt = true
5formatter = {command="bash", args=["-c", "uvx ruff check --fix - | uvx ruff format -"]}
6
7[language-server.pyrefly]
8command = "uvx"
9args = ["pyrefly", "lsp"]
On Windows it is similar except using cmd /c instead of bash -c.
To test this you can check:
1hx --health python
and in NORMAL mode
1:fmt
to force formatter to run, allowing you to check that it is configured properly.