Skip to main content
  1. Posts/

My Tmux Configuration

·323 words·2 mins
tmux neovim
Table of Contents

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
#

MyTmux

Configuration
#

Follow these steps to set up Tmux:

  1. 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
    
  2. 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
    
  3. 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
    
  4. 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.

  5. Reload the Tmux configuration file:

    Press your Tmux prefix key (my configuration uses Ctrl + Space) followed by r 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
    
  6. 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!