Remapping Caps Lock to Backspace in Xorg (Colemak, Etc)

Author: Jonathan Vasquez <jon@xyinn.org>
Last Updated: 2025-09-01-1500
Running: FreeBSD 14.3-RELEASE-p2 GENERIC amd64

pub fn main() !void

If you are using the Colemak Keyboard Layout, or you just want to remap your [Caps Lock] to [Backspace] to reduce hand travel, you can do so by adding the following to ~/.xinitrc (or wherever it works for you):

setxkbmap -option caps:backspace
xset r 66

The first command command will make the Caps key become an additional backspace, and the second command will enable autorepeat on Key 66, which will allow repeated deletions when you press and hold the Caps key. This will execute when you start Xorg via startx.

I'm doing these instructions on FreeBSD 14.3 and it's working smoothly with i3. These should also work on Linux as well. I'll eventually update this page to also have the sway/Wayland equivalents. But that won't be for a while.

References