<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>helix &amp;mdash; Nat Knight</title>
    <link>http://natknight.xyz/tag:helix</link>
    <description>Reflections, diversions, and opinions from a progressive ex-physicist programmer dad with a sore back.</description>
    <pubDate>Sat, 23 May 2026 14:43:53 -0700</pubDate>
    <item>
      <title>Setting Helix up as a Python IDE</title>
      <link>http://natknight.xyz/setting-helix-up-as-a-python-ide</link>
      <description>&lt;![CDATA[#helix #python&#xA;&#xA;This article describes how to get the [Helix] text editor set up to be a half-decent Python IDE. You&#39;ll need to know a little bit about the command line, but if you&#39;re using Helix you&#39;ll probably be fine.&#xA;&#xA;!--more--&#xA;&#xA;[Helix]: https://helix-editor.com/&#xA;&#xA;Instructions&#xA;&#xA;To assess how well Helix can support a particular language with the tools you already have, you can run:&#xA;&#xA;hx --health python&#xA;&#xA;Which will show you something like:&#xA;&#xA;Configured language servers:&#xA;  ✘ pylsp: &#39;pylsp&#39; not found in $PATH&#xA;Configured debug adapter: None&#xA;Configured formatter: None&#xA;Highlight queries: ✓&#xA;Textobject queries: ✓&#xA;Indent queries: ✓&#xA;&#xA;Helix needs us to install a Python Language Server. Rather than putting tools in our global Python environment or re-installing everything for each project, we&#39;ll use Pipx] to install it in its own virtualenv ([npx] is an analogous tool). If you don&#39;t have it installed, you can probably find instructions [here.&#xA;&#xA;[Pipx]: https://pipx.pypa.io/stable/&#xA;[npx]: https://docs.npmjs.com/cli/v7/commands/npx&#xA;&#xA;With Pipx installed, first we&#39;ll install the [Python LSP Server]&#xA;&#xA;pipx install python-lsp-server&#xA;&#xA;[Python LSP Server]: https://pypi.org/project/python-lsp-server/&#xA;&#xA;Because it aims to support multiple tools for things like typechecking and formatting, pylsp uses plugins to support those features, which need to be installed as separate packages. Luckily, Pipx supports this fairly well with its inject command. For example, to add support for [Black] and [Ruff], we can run:&#xA;&#xA;pipx inject python-lsp-server python-lsp-ruff python-lsp-black&#xA;&#xA;Helix also requires a little bit of configuration in its languages file so that it can tell pylsp which plugins to use (on Mac OS and Linux, this file should be at ~/.config/helix/languages/toml):&#xA;&#xA;[language-server.pylsp.config.pylsp]&#xA;plugins.ruff.enabled = true&#xA;plugins.black.enabled = true&#xA;&#xA;With that, Helix should be a reasonably fully featured Python IDE.&#xA;&#xA;Why do we need to do all this?&#xA;&#xA;Rather than building plugins for each programming language, Helix embraces the [Language Server Protocol]. Helix doesn&#39;t know about refactoring, type inference, etc. It just knows how to speak LSP, and relies on a separate tool (a &#34;language server&#34;) to provide all those nice features.&#xA;&#xA;The downside of this approach is that the responsibility for providing a language server falls to the user. The benefit is that Helix, despite being a relatively new project, has out-of-the box integration with over 200 languages, from common ones like Python and TypeScript to more niche languages like Gleam, Ada, and Unison.&#xA;&#xA;[Language Server Protocol]: https://microsoft.github.io/language-server-protocol/&#xA;&#xA;As I&#39;ve been learning Helix I&#39;ve been dreading the point where I had to do some customization to get some of the features I&#39;m used to in an editor like VS Code. I&#39;m not very fond of configuring text editors, having lost a great many focused hours to wrangling VimScript and Emacs Lisp so I wasn&#39;t looking forward to learning how Helix handles this, but I admit: setting Helix up this way was much easier than I was afraid it might be.&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p><a href="http://natknight.xyz/tag:helix" class="hashtag"><span>#</span><span class="p-category">helix</span></a> <a href="http://natknight.xyz/tag:python" class="hashtag"><span>#</span><span class="p-category">python</span></a></p>

<p>This article describes how to get the <a href="https://helix-editor.com/">Helix</a> text editor set up to be a half-decent Python IDE. You&#39;ll need to know a little bit about the command line, but if you&#39;re using Helix you&#39;ll probably be fine.</p>



<h2 id="instructions" id="instructions">Instructions</h2>

<p>To assess how well Helix can support a particular language with the tools you already have, you can run:</p>

<pre><code class="language-sh">hx --health python
</code></pre>

<p>Which will show you something like:</p>

<pre><code class="language-sh">Configured language servers:
  ✘ pylsp: &#39;pylsp&#39; not found in $PATH
Configured debug adapter: None
Configured formatter: None
Highlight queries: ✓
Textobject queries: ✓
Indent queries: ✓
</code></pre>

<p>Helix needs us to install a Python Language Server. Rather than putting tools in our global Python environment or re-installing everything for each project, we&#39;ll use <a href="https://pipx.pypa.io/stable/">Pipx</a> to install it in its own virtualenv (<a href="https://docs.npmjs.com/cli/v7/commands/npx">npx</a> is an analogous tool). If you don&#39;t have it installed, you can probably find instructions <a href="https://pipx.pypa.io/stable/installation/">here</a>.</p>

<p>With Pipx installed, first we&#39;ll install the <a href="https://pypi.org/project/python-lsp-server/">Python LSP Server</a></p>

<pre><code class="language-sh">pipx install python-lsp-server
</code></pre>

<p>Because it aims to support multiple tools for things like typechecking and formatting, <code>pylsp</code> uses plugins to support those features, which need to be installed as separate packages. Luckily, Pipx supports this fairly well with its <code>inject</code> command. For example, to add support for [Black] and [Ruff], we can run:</p>

<pre><code class="language-sh">pipx inject python-lsp-server python-lsp-ruff python-lsp-black
</code></pre>

<p>Helix also requires a little bit of configuration in its languages file so that it can tell <code>pylsp</code> which plugins to use (on Mac OS and Linux, this file should be at <code>~/.config/helix/languages/toml</code>):</p>

<pre><code class="language-toml">[language-server.pylsp.config.pylsp]
plugins.ruff.enabled = true
plugins.black.enabled = true
</code></pre>

<p>With that, Helix should be a reasonably fully featured Python IDE.</p>

<h2 id="why-do-we-need-to-do-all-this" id="why-do-we-need-to-do-all-this">Why do we need to do all this?</h2>

<p>Rather than building plugins for each programming language, Helix embraces the <a href="https://microsoft.github.io/language-server-protocol/">Language Server Protocol</a>. Helix doesn&#39;t know about refactoring, type inference, etc. It just knows how to speak LSP, and relies on a separate tool (a “language server”) to provide all those nice features.</p>

<p>The downside of this approach is that the responsibility for providing a language server falls to the user. The benefit is that Helix, despite being a relatively new project, has out-of-the box integration with over 200 languages, from common ones like Python and TypeScript to more niche languages like Gleam, Ada, and Unison.</p>

<p>As I&#39;ve been learning Helix I&#39;ve been dreading the point where I had to do some customization to get some of the features I&#39;m used to in an editor like VS Code. I&#39;m not very fond of configuring text editors, having lost a great many focused hours to wrangling VimScript and Emacs Lisp so I wasn&#39;t looking forward to learning how Helix handles this, but I admit: setting Helix up this way was much easier than I was afraid it might be.</p>
]]></content:encoded>
      <guid>http://natknight.xyz/setting-helix-up-as-a-python-ide</guid>
      <pubDate>Wed, 17 Apr 2024 07:00:00 +0000</pubDate>
    </item>
  </channel>
</rss>