Two of the tools I most use in my software development are Tmux and Vim. I love these tools, they are an essential part of my workflow and all their keybindings have been fused into my brain and now primarily work from muscle memory.

Making Tmux and Vim work well together is something that is critical for my workflow. One of my goals is to keep my fingers on the homerow as much as possible and as part of that I wanted to use two conflicting mapping.

I wanted to map the ESC key to CAPS LOCK in vim so that I just had to hit CAPS LOCK instead of ESC all the time.

Then I also wanted to map the CTRL key to CAPS LOCK so that in Tmux I can use CAPSLOCK as part of the Tmux prefix.

These are two potentially conflicting key mapping as I want to use the CAPSLOCK key for two different operations.

Here is how I did this on OS X Sierra.

First open up your system keyboard preferences and open the “Modifier Keys” pane. Set kki