Hacker News new | ask | show | jobs
by rsapkf 1285 days ago
Among many tricks and tips, I recommend mapping `|` and `-` to split panes:

  bind-key | split-window -h
  bind-key - split-window -v
More on my wiki: https://wiki.rsapkf.org/notes/unix/tmux/
3 comments

As an alternative for vertical splitting, using _ (instead of -) means both types of splitting require a `shift` which keeps it a little more symmetrical if that's how your brain works!
Depends on your keyboard layout. On my (Finnish) keyboard, | requires alt.
I switched from a German layout to a US layout, mainly because of objective-c with its []. Most default key bindings feel natural that way.
Ah right, fair enough!
I've bound the keys 'v' and 's' for vertical and horizontal splitting to match Vim's default bindings.

What tmux calls horizontal and vertical splits is inverse of those in Vim - hence -h flag for what most would call as vertical split. I suspect one of the authors was Australian!

There is ambiguity in vertical / horizontal split. Does it refer to the "cut" or the result?

In Sway and i3 if I make a vertical split and open a new window, it appears below (thus vertical), but the split was like a cut horizontally across. I've seen some people use the - and | keys for tmux splits which kind of avoids the language issues and turns it into which way the new line is drawn.

I recognize the ambiguity. I tend to think in terms of the result; so, in vim, I do vertical splitting because I want that result where the cleaving line runs vertically.
I don't use it a lot, but it's super handy to have this binding.