Skip to content

💻 tmux

tmux is a terminal multiplexer.

🛠 Installation

sudo apt update
sudo apt install tmux
brew install tmux

⚙ Config

A basic tmux configuration can be set up in ~/.tmux.conf.

~/.tmux.conf

# Set prefix key to 'Ctrl-a'
set -g prefix C-a
unbind C-b
bind C-a send-prefix

# Enable mouse support
set -g mouse on

# Set vi-mode for copy mode
set-window-option -g mode-keys vi

# Reload config file
bind r source-file ~/.tmux.conf \; display-message "Config reloaded!"

🐱 Catppuccin Theme

To install the Catppuccin theme for tmux, follow these steps:

  1. Clone the Catppuccin tmux plugin:

Clone Catppuccin tmux plugin

git clone https://github.com/catppuccin/tmux ~/.tmux/plugins/catppuccin
  1. Add the plugin to your ~/.tmux.conf file:

~/.tmux.conf

set -g @plugin 'catppuccin/tmux'

# Optional: Set Catppuccin flavor (mocha, macchiato, frappe, latte)
set -g @catppuccin_flavour 'mocha'

run '~/.tmux/plugins/tpm/tpm'
  1. Install tpm (Tmux Plugin Manager) if you haven't already:

Install tpm

git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
  1. Start a new tmux session or reload your tmux configuration (prefix + r), then press prefix + I (capital I) to install the plugin.

📝 Usage

To start a new tmux session:

tmux new -s my_session

To detach from a session:

tmux detach

To attach to an existing session:

tmux attach -t my_session

🔗 References