Configuration
Tmux Configuration
You can configure Tmux via the ~/.tmux.conf
file. If it doesn’t exist, create it:
$ touch ~/.tmux.conf
To reload Tmux with the new settings:
$ tmux source-file ~/.tmux.conf
Custom Keystrokes
Add these commands to ~/.tmux.conf
to modify Tmux function keys. Each command spans two lines. The unbind command deactivates the default key combination.
COMMAND
DESCRIPTION
unbind '"'
bind - split-window -v
Change key combination to split window into two horizontal panes: Replace default Ctrl+b " with Ctrl+b – (hyphen)
unbind %
bind | split-window -h
Change key combination to split window into two vertical panes: Replace default Ctrl+b % with Ctrl+b |
(pipe)
unbind C-b
set -g prefix C-a
Replace trigger key combination Ctrl+b with Ctrl+a
Making Tmux Copy Mode to default to vi keys
COMMAND
DESCRIPTION
setw -g mode-keys vi
Use vi keys in the buffer
Customization
The following commands are for customizing the status bar at the bottom of a Tmux window:
COMMAND
DESCRIPTION
set -g status-justify [left|centre|right]
Aligns the names of Tmux windows left/center/right
set -g status-left '...'
Replaces name of current session with ‘...’ in status bar
setw -g
window-status-format
`#[fg=white,bg=black]#I`
Formats the window names as follows:
Default window formatting:
Variables:
#I
: window index
#S
: session name
#W
: window name
Last updated
Was this helpful?