Introduction #
Tmux is a terminal multiplexer; it allows multiple terminal sessions to be accessed from a single window.
In this article, we’ll walk through my Tmux setup that is designed for efficient integration with Neovim.
Screenshots #
Configuration #
Follow these steps to set up Tmux:
-
Install Tmux:
If Tmux is not already installed on your system, you can install it using your package manager. For example, on Debian-based systems, run:
sudo apt-get install tmux
Verify the installation by checking the Tmux version:
tmux -V
-
Retrieve My Configuration File:
Download my Tmux configuration file into your home directory using the following command:
wget https://raw.githubusercontent.com/justicenyaga/my_nvim_config/master/.tmux.conf -O ~/.tmux.conf
-
Install Tmux Plugin Manager (tpm):
Clone the Tmux Plugin Manager repository to
~/.tmux/plugins/
using:git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
-
Create a Tmux session:
Start a new Tmux session.
tmux new -s SessionName
This should create a session and attach you to the created session.
-
Reload the Tmux configuration file:
Press your Tmux prefix key (my configuration uses
Ctrl + Space
) followed byr
to reload the configuration file:<C-Space>r
On the configuration file, replace
C-Space
with a prefered key bind to override the default prefix key bind, on the following lines:set -g prefix C-Space bind-key C-Space send-prefix
-
Install Tmux plugins:
While inside a Tmux session, install plugins by pressing your Tmux prefix key followed by
I
(uppercase):<C-Space>I
Again, replace<C-Space>
with your configured prefix key bind.
That’s it! Your Tmux environment is now configured with the specified settings and plugins. Customize further based on your preferences.
Usage #
Normal Keymaps #
Keybind | Description |
---|---|
C-Space |
Prefix key |
prefix + | |
Vertical split |
prefix + - |
Horizontal split |
prefix + r |
Reload configuration |
prefix + j/k/l/h |
Resize panes |
prefix + m |
Maximize pane |
Copy Mode Keymaps #
Keybind | Description |
---|---|
prefix + [ |
Enter copy mode |
v |
Start selection |
y |
Copy selection |
q |
Exit copy mode |
Remember to customize these keybinds further based on your preferences and workflow!