tmux: basic configuration
tmux
I’m a tmux user for most of my console sessions these days – both at work and at home. Spending some time configuring and fine-tuning tmux will go a long way as you can make this already powerful tool into a truly indispensable one.
This is the first of a few posts around tmux configuration: I would like to gradually introduce useful settings rather than just share the tmux config file. All the changes are made in the .tmux.conf file in your home directory.
Change tmux meta key
This is the very first thing I do on most tmux setups of mine: remap the Ctrl+B meta key to something easier to use.
Since I’ve been mostly on the MacOS platform for the past 5 years, I really like doing two things on the UK keyboard I have:
- map the tilda button (top left, just unde the Escape key) to backtick (`)
- map backtick (`) as the new tmux meta-key
These two steps truly change that key to a modifier key, making it much easier to invoke tmux keyboard shortcuts.
Here are the configuration lines for this:
Make tmux count windows from 1
Could be just me, but I really like my tmux windows to be numbered starting with 1 instead of the default 0. With the tmux meta key properly mapped, it just makes a lot more sense to use “meta key + 1” for selecting the first window, instead of using “meta key + 0” which is all the way across the top row of keys on the keyboard.
Here’s how I do this in .tmux.conf file:
tmux count windows from 1
Bind a key to re-load tmux config
This is the last of the initial changes I’m making to any tmux configuration: I map a certain key (meta-key + r) to reload the tmux configuration file. This saves me a restart of tmux every time I tweak some setting.
Here’s the portion from my .tmux.conf:
After you start tmux with these options in it, you can at any time press Meta-key + r and see that your .tmux.conf has just been reloaded and therefore activated:
tmux config reloaded
See Also
- macOS
- tmux
- tmux reference
- How To Get Started with tmux
- Install latest tmux in macOS
- tmux – terminal multiplexer
- tmux settings
- tmux previews for windows and sessions
- preview windows in tmux
- Change default tmux key
- tmux
- Really cool: tmux sessions survive graphics desktop logout
- How To: Change tmux Meta Key
- Getting Started with tmux
- Basic tmux configuration
- tmux sessions and graphics login to GNOME/KDE
- Getting Started with tmux
- Unix Tutorial Projects
- tmux mouse mode in macOS
- install tmux with Homebrew
- how to change tmux meta key
- Start tmux instead of login prompt on tty1
tmux
I’m a tmux user for most of my console sessions these days – both at work and at home. Spending some time configuring and fine-tuning tmux will go a long way as you can make this already powerful tool into a truly indispensable one.
This is the first of a few posts around tmux configuration: I would like to gradually introduce useful settings rather than just share the tmux config file. All the changes are made in the .tmux.conf file in your home directory.
Change tmux meta key
This is the very first thing I do on most tmux setups of mine: remap the Ctrl+B meta key to something easier to use.
Since I’ve been mostly on the MacOS platform for the past 5 years, I really like doing two things on the UK keyboard I have:
- map the tilda button (top left, just unde the Escape key) to backtick (`)
- map backtick (`) as the new tmux meta-key
These two steps truly change that key to a modifier key, making it much easier to invoke tmux keyboard shortcuts.
Here are the configuration lines for this:
Make tmux count windows from 1
Could be just me, but I really like my tmux windows to be numbered starting with 1 instead of the default 0. With the tmux meta key properly mapped, it just makes a lot more sense to use “meta key + 1” for selecting the first window, instead of using “meta key + 0” which is all the way across the top row of keys on the keyboard.
Here’s how I do this in .tmux.conf file:
tmux count windows from 1
Bind a key to re-load tmux config
This is the last of the initial changes I’m making to any tmux configuration: I map a certain key (meta-key + r) to reload the tmux configuration file. This saves me a restart of tmux every time I tweak some setting.
Here’s the portion from my .tmux.conf:
After you start tmux with these options in it, you can at any time press Meta-key + r and see that your .tmux.conf has just been reloaded and therefore activated:
tmux config reloaded
See Also
- macOS
- tmux
- tmux reference
- How To Get Started with tmux
- Install latest tmux in macOS
- tmux – terminal multiplexer
- tmux settings
- tmux previews for windows and sessions
- preview windows in tmux
- Change default tmux key
- tmux
- Really cool: tmux sessions survive graphics desktop logout
- How To: Change tmux Meta Key
- Getting Started with tmux
- Basic tmux configuration
- tmux sessions and graphics login to GNOME/KDE
- Getting Started with tmux
- Unix Tutorial Projects
- tmux mouse mode in macOS
- install tmux with Homebrew
- how to change tmux meta key
- Start tmux instead of login prompt on tty1