- Shell 100%
| assets | ||
| .gitignore | ||
| README.en-US.md | ||
| README.md | ||
| tmux.conf | ||
Table of Contents
- Overview
- Included Features
- Prerequisites
- Installation
- Plugin Management
- Other Operations
- Troubleshooting
- References
Overview
This repository contains a personal tmux configuration. It is recommended to apply these settings on a fresh tmux installation, before any customization, to avoid conflicts with existing system or user profile definitions.
By default, tmux uses /etc/tmux.conf for global behavior and ~/.tmux.conf for local, user-specific behavior. The configurations in this repository target local use, with ~/.tmux.conf pointing to ~/.tmux/main.conf, where all tmux behavior is centralized.
Included Features
| Plugin | Description |
|---|---|
| Tmux Resurrect | Enables session persistence after system shutdown. |
| Tmux Continuum | Automatically starts tmux after system or server reboot. |
Prerequisites
- tmux installed
- Git installed and configured
Installation
Create the default tmux configuration file:
touch ~/.tmux.conf
Set the path to the configuration file:
echo -n "source-file ~/.tmux/tmux.conf" >> ~/.tmux.conf
Clone this repository into the user configuration directory, following the XDG Base Directory Specification:
# Clone from Codeberg
git clone https://forge.itamarcampos.com.br/itamcampos/tmuxfiles ~/.tmux
# or... clone from GitHub
git clone https://github.com/itamcampos/tmuxfiles ~/.tmux
Install the TPM (Tmux Plugin Manager):
# Create the plugins directory and clone the TPM repository
mkdir -p ~/.tmux/plugins
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
Grant execution permissions to the TPM scripts:
find ~/.tmux/plugins/tpm -type f \( -name "*.sh" -o -path "*/bin/*" -o -path "*/bindings/*" \) -exec chmod +x {} \;
To verify the installation, open a new tmux session:
tmux new -s main
Plugin Management
Installing plugins
- Add the new plugin to
~/.tmux/tmux.confusing theset -g @plugin '...'directive - Press
Ctrl+b+I(uppercase I) to install
Saving and restoring sessions
| Operation | Shortcut |
|---|---|
| Save tmux environment | prefix + Ctrl-s |
| Restore tmux environment | prefix + Ctrl-r |
Other Operations
Remove all saved sessions:
rm -vrf ~/.tmux/plugins/tmux-continuum/*
rm -vrf ~/.tmux/plugins/tmux-resurrect/*
Restart the tmux server:
tmux kill-server
Delete all tmux configuration:
rm -vrf ~/.tmux/*
Troubleshooting
This section covers methods to resolve issues related to TPM and plugin installation.
1. Automated Installation via Temporary Session (Recommended)
Simulates the standard installation process inside a clean, temporary tmux session, minimizing conflicts with pre-existing configurations.
# Kill all tmux server instances
tmux kill-server
# Grant execution permissions to TPM components
find ~/.tmux/plugins/tpm -type f \( -name "*.sh" -o -path "*/bin/*" -o -path "*/bindings/*" \) -exec chmod +x {} \;
# Create a detached session and reload the configuration
tmux new-session -d -s temp
tmux send-keys -t temp 'tmux source-file ~/.tmux.conf' Enter
sleep 10
# Trigger plugin installation and wait for completion
tmux send-keys -t temp C-b I
sleep 10
# Verify created directories and kill the temporary session
ls -la ~/.tmux/plugins/
tmux kill-session -t temp
2. Direct Script Execution
Invokes the TPM install script directly, bypassing potential session state or keybinding inconsistencies.
export TMUX_PLUGIN_MANAGER_PATH="$HOME/.tmux/plugins/"
~/.tmux/plugins/tpm/scripts/install_plugins.sh
3. Full TPM Reinstallation
If the previous methods do not resolve the issue, a full reinstallation of TPM can fix deeper corruption or configuration problems.
# Remove the current directory and clone a fresh copy
rm -rf ~/.tmux/plugins/tpm
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# Grant permissions and restart the server
find ~/.tmux/plugins/tpm -type f \( -name "*.sh" -o -path "*/bin/*" -o -path "*/bindings/*" \) -exec chmod +x {} \;
tmux kill-server
tmux new -s main
References
- ArchLinux Documentation
- Igor Irianto
- Serhat Teker
- XDG Base Directory Specification
- Tmux Resurrect
- Tmux Continuum