Tmux split-window

Out here on the internet, one of the things I sometimes seek out are tmux setup tutorials. There are lots of customizations for tmux and the syntax of the config can take a bit of time and effort to understand. So I appreciate the tutorial writers for their walkthroughs of common config tasks. However, there is one part found in many of these guides that I think they get wrong or at least don’t give the best advice for.

The default key binds for split-window are

  • C-b " split-window horizontal
  • C-b % split-window vertical

Tutorials will often recommend changing these key-binds to something more “memorable” like C-b C-h and C-b C-v or something. I’m here to tell you that the defaults are very intuitive and memorable!

To be fair, this rebind is a convenient target for demonstrating the key-bind configuration functionality. You can demonstrate it with an empty window, so the prediliction to rebind the that command could just be to give satisfying progress for a learner.

So how are these keybinds memorable? They use weird, unrelated keys on the keyboard. There’s no link between horizontalness and a double-qoute or vertical splitting-ness for the percent sign. Or is there?

Look at a QWERTY keyboard (also works for Colmack and Workman, but not Dvorak). Notice that the percent sign is roughly halfway across the the length of the keyboard. If you drew a line through it with the aim to split the keyboard into two even halves, it would be a vertical line. The same is for the double-quote. The double quote is on the home row, and if you drew a line through it with the aim to split the keyboard into two equal halves, it would be a line across the keyboard. The keybind uses the physical keyboard layout as the metephor for the command.

I think that is pretty clever. Most keybinds use linguist (C-c for copy because “copy” starts with “C”) or symbolic (C-x for cut because the “x” looks like sissors). For a long while, I wasn’t really sure why the tmux default keybinds were the way they were and was tempted to change them to something as well. This kind of metephor is either not naturally intuitive or just not a learned connection due to it’s infrequent use in software. However, now that I know the metaphor in use, it’s hard to forget this particular keybind.


last-modified: 2024-05-18 02:07 CDT