Having (some) fun with Sublime Text and ActualVim

Jan 12, 2026

I have been using Sublime Text for more than 10 years [1], and I really love it: it's fast, has many extensions, works on all the platforms I use, and my single license allows me to use it on as many computers as I want. If it were open source, it would really be perfect ;-)

When I resumed working on GCC 18 months ago, I tried to configure Sublime to support GNU's exotic coding style, and failed. So I reverted to using my old friend vim because the GCC folks ship a vimrc that just does the right thing, but I was a bit frustrated.

Fortunately, I stumbled upon ActualVim, a Sublime package that uses neovim as "backend", giving me support for GCC's vimrc within Sublime - perfect!

At the time, I was coding 100% on an iMac, and things worked great, and when I resumed (also) using Linux, it worked OK-ish, but not as well, for reasons I did not understand nor really investigate.

The two main annoyances were:

  1. With / based search: I somehow was not accessing the history via up/down, and backspace was acting weird: for example typing /cou followed by backspace and v would look for couv instead of cov. Annoying but not the end of the world, and I got used to simply escaping the search box and restarting whenever I was typo'ing.
  2. With the "Enter" key when editing GCC code: the cursor would always be on the new line's first column, instead of being properly indented. A bit more annoying, but since I've been working on SourceHut and aerc almost exclusively in the last 6 months, it did not really bother me.

Last week, I decided to spend some time to understand what was going on, and why things worked perfectly well on my iMac and not on Linux.

A bad patch...

I added a bunch of logs and experimented, but since I was not going anywhere, I decided to just write a patch that would fix my problem, even if imperfect, and send it out for feedback (and also to understand the status of the project, that did not had any commit in the last 8 years).

This patch starts from the fact that somehow some keystrokes in Sublime don't make it to neovim, and simply accumulates them in memory, and only send the resulting string to neovim when the user validates the search.

Since it worked for me, and I assumed that I might not be the only one in the world seeing this issue, I sent the patch, ready to never hear back - again, there's not been any change in 8 years, and as much as I love it, Sublime is not the most used code editor in the world...

To my surprise, I got a reply from the maintainer within a few hours! We discussed a bit in the pull request, and agreed that it was problematic, so I discarded it.

What I find awesome here is first that the maintainer spent time to look at a random pull request in a project he has probably not looked at for years, and second that something in the discussion (not sure what) got me to think a bit more and fully understand the problem.

... to unblock everything

Sublime allows you to customize keyboard shortcuts, and I realized that I was using this on my Linux installations, but not on MacOS - because the defaults for Linux did not match the MacOS ones, that I'd gotten used to, hence needed changing. Here was the difference, finally!

I dug a bit deeper in those customizations, particularly the priority if the mapping for a given key sequence was different in the default keymap, the package's keymap and the user override.

This post explained this, and gave me a nice workaround. But first, what was going on?

Since I needed to customize some key bindings, my user keymap was a modified copy of the default one, with an action defined for the backspace key (as well as up, down and Enter). Per the priority rule, this is the mapping that was taking precedence, not the one defined by ActualVim, that says to forward the key sequence to neovim.

So whenever I typed backspace, up, down or Enter, the event would be handled natively by Sublime, and not sent to neovim, leading the exactly what I was seeing!

Knowing this, the fix is easy: create a symlink to ActualVim's keymap in my user directory, so that it takes precedence over the customized defaults. Et voilà, mystery solved!

Key takeaways

This ended up being a fun adventure, and here are the main things I take away:

  • Don´t assume that you won't get help from maintainers of seemingly dead projects; just ask questions or start a discussion, ideally with a patch, even if imperfect: worst case you don't hear back, but chances are that you do get help.
  • The urge to investigate when things are weird can cost (a lot of) time, but your world is better if you get to the bottom of things and restore balance in the force :-)

--

[1] According to my archives, I bought my first license in February ... 2014.

https://simartin.dev/blog/rss.xml