<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Thomas Letan's Blog - neovim</title>
    <link>https://soap.coffee/~lthms/tags/neovim.html</link>
    <description>Posts tagged "neovim"</description>
    <atom:link href="https://soap.coffee/~lthms/tags/neovim.xml" rel="self"
               type="application/rss+xml" />
    
    
    <item>
      <title>Introducing bepo-tsrn.nvim</title>
      <link>https://soap.coffee/~lthms/posts/BepoNvim.html</link>
      <guid>https://soap.coffee/~lthms/posts/BepoNvim.html</guid>
      <pubDate>May 23, 2024</pubDate>
      <description>
        
        &lt;h1&gt;Introducing &lt;code class=&quot;hljs&quot;&gt;bepo-tsrn.nvim&lt;/code&gt;&lt;/h1&gt;&lt;div id=&quot;tags-list&quot;&gt;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#tag&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&amp;nbsp;&lt;a href=&quot;/~lthms/tags/neovim.html&quot; class=&quot;tag hover-mint&quot; marked=&quot;&quot;&gt;neovim&lt;/a&gt; &lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#tag&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&amp;nbsp;&lt;a href=&quot;/~lthms/tags/releases.html&quot; class=&quot;tag hover-coral&quot; marked=&quot;&quot;&gt;releases&lt;/a&gt; &lt;/div&gt;
&lt;p&gt;It is not much, but I have recently &lt;a href=&quot;https://github.com/lthms/bepo-tsrn.nvim&quot; class=&quot;hover-sky&quot; marked=&quot;&quot;&gt;published on
GitHub&amp;nbsp;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#github&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt; what can be considered my very
first Neovim “plugin.”&lt;/p&gt;
&lt;p&gt;&lt;code class=&quot;hljs&quot;&gt;bepo-tsrn.nvim&lt;/code&gt; is a zero-configuration, global plugin for Neovim which remaps
default Neovim bindings for the &lt;a href=&quot;https://bepo.fr&quot; class=&quot;hover-periwinkle&quot; marked=&quot;&quot;&gt;Bépo&amp;nbsp;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#external-link&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt; keyboard layout. It
started as a fork of &lt;a href=&quot;https://github.com/cljoly/bepo.nvim&quot; class=&quot;hover-sky&quot; marked=&quot;&quot;&gt;&lt;code class=&quot;hljs&quot;&gt;bepo.nvim&lt;/code&gt;&amp;nbsp;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#github&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt; with
two significant changes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code class=&quot;hljs&quot;&gt;hjkl&lt;/code&gt; are remapped to &lt;code class=&quot;hljs&quot;&gt;tsrn&lt;/code&gt; instead of &lt;code class=&quot;hljs&quot;&gt;ctsr&lt;/code&gt;. &lt;code class=&quot;hljs&quot;&gt;hjkl&lt;/code&gt; as motion keys always
had one great drawback in my opinion: they required me to shift my left hand
whenever I wanted to use them. Well, no more!&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;hljs&quot;&gt;bepo-tsrn.nvim&lt;/code&gt; is a global plugin, unconditionally loaded at startup
without the need to explicitely load it. As a consequence, it is a very
convenient way to get Bépo enabled in Neovim system-wide. Bonus point if you
are using Archlinux, since I have added it to the &lt;a href=&quot;https://aur.archlinux.org/packages/neovim-bepo-tsrn-git&quot; class=&quot;hover-peach&quot; marked=&quot;&quot;&gt;Archlinux User
Repository&amp;nbsp;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#external-link&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt; (AUR).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code class=&quot;hljs&quot;&gt;bepo-tsrn.nvim&lt;/code&gt; is released under the terms of the Apache-2.0 license
(inherited from &lt;a href=&quot;https://github.com/cljoly/bepo.nvim&quot; class=&quot;hover-lemon&quot; marked=&quot;&quot;&gt;&lt;code class=&quot;hljs&quot;&gt;bepo.nvim&lt;/code&gt;&amp;nbsp;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#github&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt;). Granted,
this plugin targets a very small niche of users, but maybe you will find it as
useful as I do!&lt;/p&gt;
        
      </description>
    </item>
    
    
    
    <item>
      <title>What happened since December 2022?</title>
      <link>https://soap.coffee/~lthms/posts/May2023.html</link>
      <guid>https://soap.coffee/~lthms/posts/May2023.html</guid>
      <pubDate>May 18, 2023</pubDate>
      <description>
        
        &lt;h1&gt;What happened since December 2022?&lt;/h1&gt;&lt;div id=&quot;tags-list&quot;&gt;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#tag&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&amp;nbsp;&lt;a href=&quot;/~lthms/tags/emacs.html&quot; class=&quot;tag hover-lavender&quot; marked=&quot;&quot;&gt;emacs&lt;/a&gt; &lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#tag&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&amp;nbsp;&lt;a href=&quot;/~lthms/tags/meta.html&quot; class=&quot;tag hover-lemon&quot; marked=&quot;&quot;&gt;meta&lt;/a&gt; &lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#tag&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&amp;nbsp;&lt;a href=&quot;/~lthms/tags/neovim.html&quot; class=&quot;tag hover-sky&quot; marked=&quot;&quot;&gt;neovim&lt;/a&gt; &lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#tag&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&amp;nbsp;&lt;a href=&quot;/~lthms/tags/releases.html&quot; class=&quot;tag hover-mint&quot; marked=&quot;&quot;&gt;releases&lt;/a&gt; &lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#tag&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&amp;nbsp;&lt;a href=&quot;/~lthms/tags/spatial-shell.html&quot; class=&quot;tag hover-sky&quot; marked=&quot;&quot;&gt;spatial-shell&lt;/a&gt; &lt;/div&gt;
&lt;p&gt;Initially, I started this “What happened” series as an exercise to publish
more regularly on this website. Suffice to say, I haven’t done a particularly
impressive job in that regard, which only means I have a lot of room for
improvement.&lt;/p&gt;
&lt;p&gt;Anyway, if the first few months of 2023 has been mostly &lt;code class=&quot;hljs language-bash&quot;&gt;&lt;span class=&quot;hljs-variable&quot;&gt;$WORK&lt;/span&gt;&lt;/code&gt; focus,
the same cannot be said for April and May. For one, I have started
&lt;a href=&quot;/~lthms/running.html&quot; class=&quot;hover-periwinkle&quot; marked=&quot;&quot;&gt;running&lt;/a&gt; again. But this is only the tip of the iceberg.&lt;/p&gt;
&lt;h2&gt;Spatial Shell got its first releases&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/lthms/spatial-shell&quot; class=&quot;hover-lavender&quot; marked=&quot;&quot;&gt;Spatial Shell&amp;nbsp;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#github&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt; is probably my hobby
project I am most excited about. The &lt;a href=&quot;/~lthms/posts/CFTSpatialShell.html&quot; class=&quot;hover-peach&quot; marked=&quot;&quot;&gt;“call for testers”
article&lt;/a&gt; I have published recently managed to
catch the attention of a few folks&lt;label for=&quot;fn1&quot; class=&quot;sidenote-number margin-toggle&quot;&gt;&lt;/label&gt;&lt;input id=&quot;fn1&quot; type=&quot;checkbox&quot; class=&quot;margin-toggle&quot;&gt;&lt;span class=&quot;note-right sidenote note&quot;&gt;&lt;span class=&quot;footnote-p&quot;&gt;You want to hear a lesson I learned the hard way just after publishing
it? Before calling for testers, it is better to &lt;a href=&quot;https://github.com/lthms/spatial-shell/issues/2#issuecomment-1527193430&quot; class=&quot;hover-coral&quot; marked=&quot;&quot;&gt;be sure your project can
actually be compiled easily by the potential
volunteers&amp;nbsp;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#github&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt;. &lt;/span&gt;
&lt;/span&gt;. The perspective to publish such a
write-up was a very strong source of motivation for me to clean up a project I
was using daily for several months now, and I am very satisfied with the
result.&lt;/p&gt;
&lt;p&gt;Mass adoption is still a distant horizon, but still, the project is now
mainstream enough that it has already been mentioned in &lt;a href=&quot;https://discuss.ocaml.org/t/window-manager-xmonad-in-ocaml/12048/4&quot; class=&quot;hover-rose&quot; marked=&quot;&quot;&gt;a random topic on the
OCaml discourse by someone who isn’t
me&amp;nbsp;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#external-link&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt;. 🎉&lt;/p&gt;
&lt;p&gt;This led me to formally release a first version of Spatial Shell in the end of
April, and a second today. For the first time, I have also published &lt;a href=&quot;https://aur.archlinux.org/packages/spatial-shell&quot; class=&quot;hover-lemon&quot; marked=&quot;&quot;&gt;an
Archlinux package&amp;nbsp;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#external-link&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt;, to make
the life of potential early adopters even easier. Do not hesitate to upvote it
so that it can find its way to the &lt;code class=&quot;hljs&quot;&gt;extra&lt;/code&gt; repository some day.&lt;/p&gt;
&lt;h2&gt;Goodbye Emacs! Remember me, Neovim?&lt;/h2&gt;
&lt;p&gt;In 2015, I started using Coq for my PhD thesis and at the time, there was no
real support for (Neo)vim&lt;label for=&quot;fn2&quot; class=&quot;sidenote-number margin-toggle&quot;&gt;&lt;/label&gt;&lt;input id=&quot;fn2&quot; type=&quot;checkbox&quot; class=&quot;margin-toggle&quot;&gt;&lt;span class=&quot;note-left sidenote note&quot;&gt;&lt;span class=&quot;footnote-p&quot;&gt;The situation later improved. Nowadays, you can implement your theories
using &lt;a href=&quot;https://github.com/whonore/Coqtail&quot; class=&quot;hover-rose&quot; marked=&quot;&quot;&gt;Coqtail&amp;nbsp;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#github&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt;, and &lt;a href=&quot;https://github.com/ejgallego/coq-lsp&quot; class=&quot;hover-mint&quot; marked=&quot;&quot;&gt;Coq
LSP&amp;nbsp;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#github&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt; will probably become a viable
and interesting setup in a near future. &lt;/span&gt;
&lt;/span&gt;. Everyone was using &lt;a href=&quot;https://proofgeneral.github.io/&quot; class=&quot;hover-rose&quot; marked=&quot;&quot;&gt;Proof
General&amp;nbsp;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#github&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt; and Emacs, so I was left with little
choice but to follow through. With only my courage and the &lt;a href=&quot;https://juanjoalvarez.net/posts/2014/vim-emacsevil-chaotic-migration-guide/&quot; class=&quot;hover-lavender&quot; marked=&quot;&quot;&gt;good advice of a
fellow “vimer” who had also made a similar
journey&amp;nbsp;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#external-link&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt;,
I started using Emacs.&lt;/p&gt;
&lt;p&gt;Fast forward 8 years later, and my &lt;a href=&quot;https://src.soap.coffee/dotfiles/emacs.d&quot; class=&quot;hover-peach&quot; marked=&quot;&quot;&gt;Emacs
configuration&amp;nbsp;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#external-link&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt; has become a project
of its own. Overall, I was pretty happy with my setup, but in the same time, I
always remained a bit nostalgic of my Neovim days. This is probably why I
decided to give this old friend a try when my company bought me a new laptop. I
also used this as an opportunity to try out this LSP-thing everyone was talking
about.&lt;/p&gt;
&lt;p&gt;It has been a month now, and I do not plan to come back to my previous habits.
There are still some few edges here and there, I still need to get my head
around lua, but LSP is nice, and plugins like
&lt;a href=&quot;https://github.com/nvim-telescope/telescope.nvim&quot; class=&quot;hover-periwinkle&quot; marked=&quot;&quot;&gt;telescope&amp;nbsp;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#github&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt; are simply too
beautiful.&lt;/p&gt;
&lt;p&gt;That being said, there was one aspect of moving from Emacs to Neovim I had not
anticipated: Org mode. Which constitutes a perfect transition to the next
session.&lt;/p&gt;
&lt;h2&gt;Website redesign, again&lt;/h2&gt;
&lt;p&gt;Did you notice this website has been revamping recently? The changes are
actually deeper than “just” a redesign, to a point where I had to port &lt;em&gt;all&lt;/em&gt; my
write-ups to a different markup language&lt;label for=&quot;fn3&quot; class=&quot;sidenote-number margin-toggle&quot;&gt;&lt;/label&gt;&lt;input id=&quot;fn3&quot; type=&quot;checkbox&quot; class=&quot;margin-toggle&quot;&gt;&lt;span class=&quot;note-right sidenote note&quot;&gt;&lt;span class=&quot;footnote-p&quot;&gt;Are you starting to understand why “Org mode” was the perfect
transition to move on to this section? &lt;/span&gt;
&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;Why, you ask? Well, it’s actually pretty simple: as time goes, I’ve grown
lazier.&lt;/p&gt;
&lt;p&gt;Let me give you some context. Until very recently, my website was built around
the idea to have literate programming as a first-class citizen of my author
tools. For instance, you can have a look at &lt;a href=&quot;/~lthms/posts/CleopatraV1.html&quot; class=&quot;hover-lemon&quot; marked=&quot;&quot;&gt;what used to be the literate
program which was responsible for generating the
website&lt;/a&gt;. Similarly, most of &lt;a href=&quot;/~lthms/tags/coq.html&quot; class=&quot;hover-coral&quot; marked=&quot;&quot;&gt;my write-ups about
Coq&lt;/a&gt; were actually Coq documents. Literate programming is
actually a very nice paradigm for authoring technical contents, because it
gives you the tools to keep said contents accurate and up-to-date. In a
nutshell, you cannot have a typo in one of your code snippets which would
prevent it from compiling, because you actually
compile the snippet and catch the typo when you try to generate your website.
Or at least, it is what I used to do.&lt;/p&gt;
&lt;p&gt;I decided to stop because, for all its benefits, this approach has one major
drawback: it is hard to maintain. I had invested quite some time and efforts to
keep my website sources under control, but it really was an everyday fight.
There are some strange things which start happening when you fully commit to
this, as I think I did. For instance, software dependencies tie your article
together. Suddenly, you cannot talk about this new fancy feature of the latest
Coq release without upgrading &lt;em&gt;all&lt;/em&gt; your write-ups implemented as Coq
documents&lt;label for=&quot;fn4&quot; class=&quot;sidenote-number margin-toggle&quot;&gt;&lt;/label&gt;&lt;input id=&quot;fn4&quot; type=&quot;checkbox&quot; class=&quot;margin-toggle&quot;&gt;&lt;span class=&quot;note-left sidenote note&quot;&gt;&lt;span class=&quot;footnote-p&quot;&gt;Well, in theory you can. Just have each Coq document specifies the
Coq version it requires, and support this level of customization in your
build toolchain. But then, your blog takes forever to build from a cold
repository. &lt;/span&gt;
&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;That being said, most of the work had already been done. This website &lt;em&gt;was&lt;/em&gt; a
collection of literate programs, and I was pretty proud of the state of things.
I could deal with the annoyances&lt;label for=&quot;fn5&quot; class=&quot;sidenote-number margin-toggle&quot;&gt;&lt;/label&gt;&lt;input id=&quot;fn5&quot; type=&quot;checkbox&quot; class=&quot;margin-toggle&quot;&gt;&lt;span class=&quot;note-right sidenote note&quot;&gt;&lt;span class=&quot;footnote-p&quot;&gt;Like using Coqdoc syntax to write my articles, for instance. I could
write about how the Coqdoc syntax irks me for ages. &lt;/span&gt;
&lt;/span&gt;. But then, as I explained in the
previous section, I decided to move away from Emacs. The first time I tried to
start a new write-up, it hit me.&lt;/p&gt;
&lt;p&gt;I used to write most of my contents using Org mode. Org mode, also known as
&lt;em&gt;the&lt;/em&gt; Emacs markup language.&lt;/p&gt;
&lt;p&gt;I know of at least &lt;a href=&quot;https://github.com/nvim-orgmode/orgmode&quot; class=&quot;hover-mint&quot; marked=&quot;&quot;&gt;one “Org plugin” for
Neovim&amp;nbsp;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#github&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt;, but instead of giving it a
try, I decided to use this opportunity to tackle my “maintenance problem” once
and for all. &lt;em&gt;I gave up on literate programming for this website.&lt;/em&gt; As a result,
this website is now generated from Markdown files only (using
&lt;a href=&quot;https://github.com/markdown-it/markdown-it&quot; class=&quot;hover-lavender&quot; marked=&quot;&quot;&gt;markdown-it&amp;nbsp;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#github&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt; with many plugins).
As a consequence, the generated HTML is way more “predictable.” This was enough
to motivate me at giving a try at &lt;a href=&quot;https://soupault.app/reference-manual/#metadata-extraction-and-rendering&quot; class=&quot;hover-peach&quot; marked=&quot;&quot;&gt;Soupault’s
indexes&amp;nbsp;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#external-link&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt;,
which are way more powerful than I anticipated. Now, this website has&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Tags. Each write-up can be labeled with as many tags as I want, there is &lt;a href=&quot;/~lthms/tags&quot; class=&quot;hover-coral&quot; marked=&quot;&quot;&gt;a
page which lists all the tags used in the website&lt;/a&gt;, and each tag has
its own page (for instance, the &lt;a href=&quot;/~lthms/tags/coq.html&quot; class=&quot;hover-periwinkle&quot; marked=&quot;&quot;&gt;&lt;code class=&quot;hljs&quot;&gt;coq&lt;/code&gt; tag&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;A &lt;a href=&quot;/~lthms/posts/index.xml&quot; class=&quot;hover-peach&quot; marked=&quot;&quot;&gt;RSS feed&lt;/a&gt;. It was actually one of the main features I
really wanted to get with this revamp.&lt;/li&gt;
&lt;li&gt;Automatically generated list of articles in the &lt;a href=&quot;/~lthms/&quot; class=&quot;hover-mint&quot; marked=&quot;&quot;&gt;home page&lt;/a&gt;, for each
series (see the &lt;a href=&quot;/~lthms/series/Ltac.html&quot; class=&quot;hover-peach&quot; marked=&quot;&quot;&gt;Ltac series&lt;/a&gt; for instance). Before, I was
publishing “curated indexes,” or put in other words: I was writing these
indexes myself, by hand. And again, I’ve grown lazier.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It took me a week to go through this rework. Translating manually every write-up
was tedious, to say the least, as was implementing the Lua plugins for Soupault
since I have neither proficiency nor tooling to help me write Lua code. But I
am very glad for the final result.&lt;/p&gt;
&lt;p&gt;Also, I have invested in an Antidote license, so hopefully, this website will
have fewer typos and English butchering as of now. A clean text, delivered with
a nice and simple design, from a sane and maintainable &lt;a href=&quot;https://src.soap.coffee/soap.coffee/lthms.git/&quot; class=&quot;hover-lavender&quot; marked=&quot;&quot;&gt;Git
repository&amp;nbsp;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#external-link&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
        
      </description>
    </item>
    
    
    
    <item>
      <title>Neovim, OCaml Interfaces, Tree-Sitter and LSP</title>
      <link>https://soap.coffee/~lthms/posts/NeovimOCamlTreeSitterAndLSP.html</link>
      <guid>https://soap.coffee/~lthms/posts/NeovimOCamlTreeSitterAndLSP.html</guid>
      <pubDate>May 1, 2023</pubDate>
      <description>
        
        &lt;h1&gt;Neovim, OCaml Interfaces, Tree-Sitter and LSP&lt;/h1&gt;&lt;div id=&quot;tags-list&quot;&gt;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#tag&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&amp;nbsp;&lt;a href=&quot;/~lthms/tags/ocaml.html&quot; class=&quot;tag hover-coral&quot; marked=&quot;&quot;&gt;ocaml&lt;/a&gt; &lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#tag&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&amp;nbsp;&lt;a href=&quot;/~lthms/tags/neovim.html&quot; class=&quot;tag hover-peach&quot; marked=&quot;&quot;&gt;neovim&lt;/a&gt; &lt;/div&gt;
&lt;p&gt;Can we all agree that witnessing syntax highlighting being absolutely off is
probably the most annoying thing that can happen to anybody?&lt;/p&gt;
&lt;p&gt;I mean, just look at this horror.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;figure&gt;&lt;img src=&quot;/~lthms/img/wrong-highlighting.png&quot;&gt;&lt;figcaption&gt;&lt;p&gt;Syntax highlighting being absolutely wrong.&lt;/p&gt;&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What you are looking at is the result of trying to enable &lt;code class=&quot;hljs&quot;&gt;tree-sitter&lt;/code&gt; for
OCaml hacking and calling it a day. In a nutshell, OCaml &lt;code class=&quot;hljs&quot;&gt;mli&lt;/code&gt; files are
quickly turning into a random mess of nonsensical colors, and I didn’t know
why. I tried to blame
&lt;a href=&quot;https://github.com/tree-sitter/tree-sitter-ocaml/issues/72&quot; class=&quot;hover-coral&quot; marked=&quot;&quot;&gt;&lt;code class=&quot;hljs&quot;&gt;tree-sitter-ocaml&lt;/code&gt;&amp;nbsp;&lt;span class=&quot;icon&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/~lthms/img/icons.svg#github&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt;,
but, of course I was wrong.&lt;/p&gt;
&lt;p&gt;The issue is subtle, and to be honest, I don’t know if I totally grasp it. But
from my rough understanding, it breaks down as follows.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code class=&quot;hljs&quot;&gt;tree-sitter-ocaml&lt;/code&gt; defines two grammars: &lt;code class=&quot;hljs&quot;&gt;ocaml&lt;/code&gt; for the &lt;code class=&quot;hljs&quot;&gt;ml&lt;/code&gt; files, and
&lt;code class=&quot;hljs&quot;&gt;ocaml_interface&lt;/code&gt; (but &lt;code class=&quot;hljs&quot;&gt;ocamlinterface&lt;/code&gt; also works) for the &lt;code class=&quot;hljs&quot;&gt;mli&lt;/code&gt; files&lt;/li&gt;
&lt;li&gt;By default, neovim uses the filetype &lt;code class=&quot;hljs&quot;&gt;ocaml&lt;/code&gt; for &lt;code class=&quot;hljs&quot;&gt;mli&lt;/code&gt; files, so the incorrect
parser is being used for syntax highlighting. This explains the root issue&lt;/li&gt;
&lt;li&gt;Bonus: &lt;code class=&quot;hljs&quot;&gt;ocamllsp&lt;/code&gt; does not recognize the &lt;code class=&quot;hljs&quot;&gt;ocamlinterface&lt;/code&gt; filetype by
default (but somehow use the &lt;code class=&quot;hljs&quot;&gt;ocaml.interface&lt;/code&gt; id for &lt;code class=&quot;hljs&quot;&gt;mli&lt;/code&gt; files…&lt;label for=&quot;fn1&quot; class=&quot;sidenote-number margin-toggle&quot;&gt;&lt;/label&gt;&lt;input id=&quot;fn1&quot; type=&quot;checkbox&quot; class=&quot;margin-toggle&quot;&gt;&lt;span class=&quot;note-right sidenote note&quot;&gt;&lt;span class=&quot;footnote-p&quot;&gt;There is probably something to be done here. &lt;/span&gt;
&lt;/span&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So, in order to have both &lt;code class=&quot;hljs&quot;&gt;tree-sitter&lt;/code&gt; and &lt;code class=&quot;hljs&quot;&gt;ocamllsp&lt;/code&gt; working at the same
time, I had to tweak my configuration a little bit.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;hljs language-lua&quot;&gt;lspconfig.ocamllsp.setup({
  filetypes = vim.list_extend(
    &lt;span class=&quot;hljs-built_in&quot;&gt;require&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&apos;lspconfig.server_configurations.ocamllsp&apos;&lt;/span&gt;)
      .default_config
      .filetypes,
    { &lt;span class=&quot;hljs-string&quot;&gt;&apos;ocamlinterface&apos;&lt;/span&gt; }
  ),
})

vim.cmd(&lt;span class=&quot;hljs-string&quot;&gt;[[au! BufNewFile,BufRead *.mli setfiletype ocamlinterface]]&lt;/span&gt;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And now, I am blessed with a consistent syntax highlighting for my &lt;code class=&quot;hljs&quot;&gt;mli&lt;/code&gt; files.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;figure&gt;&lt;img src=&quot;/~lthms/img/good-highlighting.png&quot;&gt;&lt;figcaption&gt;&lt;p&gt;Syntax highlighting being absolutely right.&lt;/p&gt;&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;&lt;/p&gt;
        
      </description>
    </item>
    
    
  </channel>
</rss>
