sajad torkamani

Install

brew install tmux

Bindings + commands

CommandDescription
tmux lsList session
tmux detachDetach from current session
tmux attachAttach to the latest session
tmux attach -t <session>Attach to a particular session
tmux kill-serverKill all session
tmux kill-session -t <session>Kill a specific session
tmux kill-session -aKill all other sessions (excluding the active session)
<prefix>, $Rename current-session
<prefix>, : and then type `select-pane -T <pane-name>Rename page
<prefix>, : and then type splitw -fvAdd horizontal pane that spans full window with

  • Prefix + :
    • Open prompt
  • prefix + z
    • Toggle zoom
  • tmux detach
    • Detach from session
  • tmux attach
  • tmux attach -t <name>

Configure

Create a ~/.tmux.conf and tmux should pick up your config automatically.

Create Bash /ZSH aliases

# Tmux
alias t="tmux"
alias tl="tmux ls"
alias tx="tmux kill-server"

Configure VIM-like keybindings:

# Remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix

# Split window horizontally
bind-key n split-window -h

# Split window vertically
bind-key v split-window -v

# Bind keys for moving panes
bind-key k select-pane -U
bind-key l select-pane -R
bind-key j select-pane -D
bind-key h select-pane -L

# Bind key for closing pane
bind-key q kill-pane

# Enable mouse control (clickable windows, panes, resizable panes)
set -g mouse on

Sources/links

Tagged: Misc

Leave a comment

Your email address will not be published. Required fields are marked *