Caps Lock - From Shouting to Superpower

Rethinking the functionality of a forgotten key could lead to a powerful new tool.

Caps Lock - From Shouting to Superpower

Caps Lock sits in prime keyboard real estate—right next to your home row—but most people only use it for SHOUTING IN ALL CAPS. That’s a waste.

I remapped mine to do something useful: tap it for Escape (great for vim), hold it as a modifier for arrow keys, Home, End, Backspace, and Delete. No more reaching across the keyboard.

Linux

Starting with Linux, we can configure caps lock using xremap (works with both the X11 and Wayland environment).

Provided below is the configuration I currently use. Tapping the caps lock key makes it the escape button. This is very useful for us vim lowers. Holding it down and it acts like a modifier for easier access to keys like Home, End, Back space, Delete and all the arrow keys.

Grab the latest release and save it to a convenient location, for example: /home/user/bin/xremap

Create a new file named xremap-config.yml (or a similar) in your configuration directory /home/user/.config/xremap-config.yml:

virtual_modifiers:
  - CapsLock
keymap:
  - remap:
      CapsLock-h: Left
      CapsLock-j: Down
      CapsLock-k: Up
      CapsLock-l: Right
      CapsLock-d: Delete
      CapsLock-f: BackSpace
      CapsLock-i: Home
      CapsLock-o: End
modmap:
  - remap:
      KEY_CAPSLOCK:
        held: KEY_CAPSLOCK
        alone: KEY_ESC

To be able to start xremap when we boot up, create a systemd service with the following contents and save it to: /etc/systemd/user/xremap.service.

[Unit]
Description=Start xremap

[Service]
Type=simple
ExecStart=/home/user/bin/xremap /home/user/.config/xremap-config.yml --watch

[Install]
WantedBy=default.target

Notice the --watch flag, this makes xremap watch for newly connected devices and apply the configuration to them as well.

Then we need to run the following commands to enable it:

systemctl --user daemon-reload - Reload so systemctl can find our new service.

systemctl --user start xremap.service - Start the service.

systemctl --user enable xremap.service - Make the service start on boot.

MacOS

In MacOS we can achive the same functionaliy using an application called Karabiner and loading the script provided by https://github.com/Vonng/Capslock. Follow the installation steps to get started.

More Articles

Generate Commit Messages with Ollama in Neovim

Generate Commit Messages with Ollama in Neovim

Generate conventional commit messages from staged diffs using Ollama. Run it locally for privacy and offline, or use cloud models for speed.

Adding Umami analytics to the OpenClaw morning brief

Adding Umami analytics to the OpenClaw morning brief

An agent skill that fetches traffic data from Umami, and how it fits into a daily automated briefing.

Setting up Google Calendar sync for OpenClaw

Setting up Google Calendar sync for OpenClaw

How I set up read-only Google Calendar sync for my personal AI assistant running on a home server VM.

Better Clipboard Handling in Claude Code

Better Clipboard Handling in Claude Code

A plugin that makes clipboard operations in Claude Code more reliable and natural to use.

Get notified when Claude Code needs your input

Get notified when Claude Code needs your input

Stop constantly checking your terminal. Set up notifications that alert you when Claude Code is ready for your input.

Auto-format generated Code with Claude Code Hooks

Auto-format generated Code with Claude Code Hooks

How to set up a PostToolUse hook in Claude Code to automatically run prettier after every file edit or write operation.

PWA Web Share Target on Android: The Absolute URL Fix

PWA Web Share Target on Android: The Absolute URL Fix

Getting the Web Share Target API to work on Android PWAs can be frustrating. Your manifest looks correct, but the app never appears in the share sheet. Here is what finally worked.

Standard function keys on external keyboards in MacOS

Standard function keys on external keyboards in MacOS

Configure Karabiner Elements to use standard function keys on external keyboards while keeping media keys on your MacBook.

How to Clear Cloudflare Cache using a webhook

How to Clear Cloudflare Cache using a webhook

Automatically purge Cloudflare cache using webhooks and API tokens.