DEV Community

Andy Huynh
Andy Huynh

Posted on

1

Vim tip - remap CAPS LOCK to control

Before

Default control mapping

After

Modded to caps lock

If carpel tunnel is a real fear, remapping control key will assuage your troubles.

Many Vim packages rely on control to unlock their Vim toolset. Tmux uses it (in conjunction with the literal letter 'b') to move to different panes (tmux). This is the primary reason for this post.

Ergonomically control is in a shitty spot on standard keyboard layouts. Reaching for control, over time, garners pain in your hands quicker than you think. I've used Vim for the past five years with no finger pain. I include instructions to remap CAPS LOCK below:

1. Open system preferences
Go to system preferences

2. Find and click the keyboard icon
mac keyboard section

3. Click modifier keys
mac modifier keys

4. Set caps lock to control
caps lock to control

5. (Optional) Set CTRL-b to CTRL-a in .tmux.conf

# Ctrl-b sucks. lets bind ctrl-a instead
unbind C-b
set -g prefix C-a
Enter fullscreen mode Exit fullscreen mode

The literal letter 'a' is closer to CAPS LOCK than 'b'.

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (1)

Collapse
 
briancodes profile image
Brian β€’

Ctrl+R in terminal for command history is one I use a lot - switching my Caps Lock now πŸ‘

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay