So you’ve installed tmux but you’re probably wondering why the default configuration is so unintuitive. Well I’ve scoured the internet (really just Googled and read a bunch of other blog posts) to arrive at my favorite minimal viable settings for tmux. Nothing too fancy or complicated, just more intuitive shortcuts. Lets get started.
###Editing your tmux.conf file
Changing your tmux settings is as straightforward as editing the .tmux.conf file found in your home directory (e.g. ~/.tmux.conf). If you don’t already have this file, go ahead and create it before you get going
Important to note: after you edit the config file, tmux won’t pick up the changes until you manually refresh. To do this: from within a tmux session hit the prefix shortcut, by default Ctrl-b, then type the :source-file command to reload…
###Replace the default prefix key binding
Speaking of prefix shortcuts… by default you enter tmux’s command mode by using a keyboard sequence called the prefix shortcut (by default Ctrl-b). The default prefix was never too memorable so I much prefer Ctrl-space to mimic the way you enter Mac OSX’s spotlight search. Add the following to your .tmux.conf file to change the prefix shortcut to Ctrl-space.
Remember, your prefix shortcut will be Ctrl-b until you refresh using the :source-file ~/.tmux.conf command like I mentioned above.
###Intuitive split commands
When I first started using tmux, one of the things I found the most frustrating was remembering how to split the terminal into multiple panels, tmux’s flagstone feature. Mapping horizontal split to –, and vertical split to | is much more intuitive than the default “ and % mapping.
Source: Inspiration for these split commands comes from this nice article by Ham Vocke.
Configuring tmux to use the mouse for scrolling used to be a hassle, but thankfully in tmux 2.0 there is now a single config option to enable mouse mode.
###The powerline plugin
Powerline will customize the rather basic tmux status/window manager bar and turn it into something much more visual pleasing and useful. Although powerline is a bit beyond the scope of this post it’s definitely worth the effort, so be on the look out for my post about installing and customizing powerline for tmux.