One of the nice things about tmux is that it’s really scriptable, so you can do cool stuff like set up a workspace with a script. I find this much more convenient than those automagic state-managing plugins.
Other than this, two useful keybinds I use:
# Search with <C-f>, instead of awkward <C-p>[?
bind-key -n C-f copy-mode \; send-key ?
# Renumber windows sequentially
bind-key R \
set -g renumber-windows on\; \
new-window\; kill-window\; \
set -g renumber-windows off\;
I think the latter is done easier by bind R move-window -r.
bind R move-window -r
It looks you’re correct, thanks. I think that has been in my tmux.conf from since before that was a feature 😅
Is there some tmux trigger key that doesn’t interfere with readline? Maybe this is a bad habit on my part, but I frequently use C-a to go to the beginning of the line. This is mostly why I’ve been hesitant to use tmux. Similarly with C-b to go back a single character, though I use that much less frequently.
I use the backtick (`) character. I unbind C-b, bind backtick, and then set a double-backtick to produce a literal one. The character comes up infrequently for me, and double-tapping it to make a literal one isn’t much of a challenge when it happens. The key position is close to the escape key, which I enjoy as a vim regular. (I also rebind most movement keys to vim-like as well)
Here’s the code that sets my leader
You’ll get a ton of different answers here, but I like M-a
I’ve been using screen and then tmux with the same keybindings, and typing C-a a to go to the start of a line is now second nature to me. So much so that I get tripped up outside tmux…
I’ve been using ctrl-v in both screen and tmux for as long as I can remember for exactly this reason. Ctrl-v is only rarely used (it’s for inserting a literal control character).
I use C-o but it could be that it only makes sense with Dvorak as keyboard layout. On the other hand I tend to always have both hands on the keyboard.
I use C-z.
There’s a huge discussion of that in this superuser question.
This SU question may be related: https://superuser.com/q/74492/18192
If you’re using MacOS (as OP is), what is the advantage of tmux in $CURRENT_YEAR over iterm2?
I use it locally inside of iterm. Tmux reels you in work panes and windows (splits and tabs) but it is much more when you get used to it.
Different scriptable sessions for each project you’re working on its one really nice feature, “zoom” (full screen of single pane) is also really nice when concentrating in for instance a editor widow or a particular log.
For local usage, probably none. I live much of my online life (IRC, Twitter, random hackery) on a remote VPS and tmux really shines there.
It really can restore states? Long time screen user and if that’s true, I’m sold.