Tmux is a really powerful tool, and very configurable. If you search online you’ll find tons of resources about fancy tricks and advanced setup. Which is cool for people wanting to really dig in. But if you’re starting from scratch, here are a few tips to get you going.

1. Change the prefix

By default, the “prefix” (the key combination that prefixes any tmux shortcut) is C-b, which is very awkward for most people.

So instead, we can remap it to C-a with this section in the ~/.tmux.conf file.

# Switch to C-a for the prefix
set -g prefix C-a
unbind C-b

(This prefix is especially handy for me because I have my Caps Lock key remapped to Ctrl.)

2. Learn the very basic shortcuts

  • C-a c: Create a new window
  • C-a C-n: Go to next window
  • C-a C-p: Go to previous window
  • C-a &: Kill window (useful if it is stuck, eg. in a timed-out ssh session)

3. Learn how to move windows

Sometimes, it is very useful to be able to move the windows right or left. To enable this, we need to add a little more to our ~/.tmux.conf:

bind C-l swap-window -t +1
bind C-h swap-window -t -1

Now, you can move the current window one position to the right with C-a C-l and left with C-a C-h.

Done

That’s it. In my experience you get most of the value out of tmux with just this minimal setup.

Of course, some people do amazing things with tmux, and I’m not saying that this is not worth the time. Just that it is a big time investment compared to just getting off the ground and starting to use tmux.

I have experimented with slightly more advanced features, and I may write about them in the future. But it’s rare enough for me that I usually have google for the commands anyway.

In case anyone finds it useful, my slightly messy tmux config can be found here.