Chapter 2. Configuring tmux
Now that we've had our first taste of tmux, let's dig into our first topic in greater detail. tmux is a very powerful program and thankfully one that is also highly configurable. You can change almost anything about its behavior, from the way it looks and feels to the commands it executes on load; you can even configure every key combination to which tmux responds.
In this chapter, we will cover various ways to configure tmux to customize and optimize it for your workflow. We will build a sample configuration that can be used to make tmux a bit cleaner, prettier, and more useful.
We will be unable to cover every minute detail or configuration option, but we will hit the most common ones and set you up with the knowledge and toolset to be able to tackle any configuration you desire. In this chapter, we will discuss the following:
- Using the
set-option
command - Creating a tmux configuration file
- Emacs or vi mode
- Enabling mouse modes
- Changing the status bar
- Modifying the background color of the status bar
- Reloading the configuration
- Changing the foreground color of the status bar
- Highlighting the active window
- Binding keys
- Viewing current bindings
- Chaining multiple commands to a single key
- Comments in the configuration file
- Rebinding the prefix key
- Binding a new prefix key
- Binding keys without the prefix key
- Unbinding keys
- Revising the status bar
- Option types
- Handy configuration tips
By the end of this chapter, we will also have built up a sample configuration file that you can use as a starting point for your own personalized configuration.