Skip to content

Instantly share code, notes, and snippets.

@trungnt13
Last active April 10, 2026 09:07
Show Gist options
  • Select an option

  • Save trungnt13/34a8b101ab7fe14f7f0f194d1f63ad6c to your computer and use it in GitHub Desktop.

Select an option

Save trungnt13/34a8b101ab7fe14f7f0f194d1f63ad6c to your computer and use it in GitHub Desktop.

Revisions

  1. trungnt13 revised this gist Apr 10, 2026. No changes.
  2. trungnt13 revised this gist Apr 10, 2026. No changes.
  3. trungnt13 revised this gist Apr 10, 2026. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions tmux_linux.conf
    Original file line number Diff line number Diff line change
    @@ -146,13 +146,11 @@ bind 8 \
    split-window -h -c "#{pane_current_path}" \;\
    select-layout even-horizontal

    # Prefix+9: toggle between even-horizontal (3 equal columns) and main-vertical (1 big + 2 stacked)
    # Prefix+9: 3 equal vertical panes (side-by-side columns)
    # Creates panes first if fewer than 3 exist
    bind 9 if-shell "[ #{window_panes} -lt 3 ]" \
    "split-window -h -c '#{pane_current_path}' \; split-window -h -c '#{pane_current_path}' \; select-layout even-horizontal" \
    "if-shell 'echo \"#{window_layout}\" | grep -q ^even-horizontal' \
    'select-layout main-vertical' \
    'select-layout even-horizontal'"
    "select-layout even-horizontal"

    # Prefix + Alt-4: 2×2 grid
    bind 0 \
  4. trungnt13 revised this gist Apr 10, 2026. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion tmux_linux.conf
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # tmux.conf for macOS (Apple Silicon) — multi-agent coding sessions
    # tmux.conf for Linux — multi-agent coding sessions
    # v4 — 10Apr26
    # v3 — 17Feb26
    #
  5. trungnt13 revised this gist Apr 10, 2026. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions tmux_linux.conf
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    # tmux.conf for macOS (Apple Silicon) — multi-agent coding sessions
    # v4 — 10Apr26
    # v3 — 17Feb26
    #
    # ╭─────────────────────── QUICK START ───────────────────────╮
  6. trungnt13 revised this gist Apr 10, 2026. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion tmux_linux.conf
    Original file line number Diff line number Diff line change
    @@ -38,7 +38,9 @@
    # ╰───────────────────────────────────────────────────────────╯

    # ─── Core ────────────────────────────────────────────────────────────────────
    set -g default-shell /bin/bash
    set-option -g default-command "/bin/bash --rcfile ~/.bashrc"
    set-option -g default-shell /bin/bash

    set -g history-limit 250000 # agents produce lots of output
    set -g default-terminal "tmux-256color"
    set -sa terminal-overrides ",xterm-256color:Tc" # 24-bit color passthrough
  7. trungnt13 revised this gist Apr 9, 2026. No changes.
  8. trungnt13 revised this gist Apr 9, 2026. No changes.
  9. trungnt13 revised this gist Apr 9, 2026. No changes.
  10. trungnt13 revised this gist Apr 9, 2026. No changes.
  11. trungnt13 revised this gist Apr 9, 2026. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions tmux_linux.conf
    Original file line number Diff line number Diff line change
    @@ -143,13 +143,13 @@ bind 8 \
    split-window -h -c "#{pane_current_path}" \;\
    select-layout even-horizontal

    # Prefix+9: toggle between main-vertical (1 big + 2 stacked) and even-horizontal (3 columns)
    # Prefix+9: toggle between even-horizontal (3 equal columns) and main-vertical (1 big + 2 stacked)
    # Creates panes first if fewer than 3 exist
    bind 9 if-shell "[ #{window_panes} -lt 3 ]" \
    "split-window -h -c '#{pane_current_path}' \; split-window -v -c '#{pane_current_path}' \; select-layout main-vertical" \
    "if-shell 'echo \"#{window_layout}\" | grep -q ^main-vertical' \
    'select-layout even-horizontal' \
    'select-layout main-vertical'"
    "split-window -h -c '#{pane_current_path}' \; split-window -h -c '#{pane_current_path}' \; select-layout even-horizontal" \
    "if-shell 'echo \"#{window_layout}\" | grep -q ^even-horizontal' \
    'select-layout main-vertical' \
    'select-layout even-horizontal'"

    # Prefix + Alt-4: 2×2 grid
    bind 0 \
  12. trungnt13 revised this gist Apr 7, 2026. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions tmux_linux.conf
    Original file line number Diff line number Diff line change
    @@ -38,6 +38,7 @@
    # ╰───────────────────────────────────────────────────────────╯

    # ─── Core ────────────────────────────────────────────────────────────────────
    set -g default-shell /bin/bash
    set -g history-limit 250000 # agents produce lots of output
    set -g default-terminal "tmux-256color"
    set -sa terminal-overrides ",xterm-256color:Tc" # 24-bit color passthrough
  13. trungnt13 revised this gist Mar 24, 2026. No changes.
  14. trungnt13 revised this gist Mar 24, 2026. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion tmux_linux.conf
    Original file line number Diff line number Diff line change
    @@ -63,7 +63,7 @@ set -g pane-active-border-style "fg=#ff6600,bg=default"
    set -g pane-border-lines heavy # thicker borders — easy to see splits

    # Status bar — hidden (zen mode); toggle with Prefix+B
    set -g status off
    set -g status on
    set -g status-position top
    set -g status-interval 5
    set -g status-style "bg=#1a1a2e,fg=#e0e0e0"
  15. trungnt13 revised this gist Feb 18, 2026. No changes.
  16. trungnt13 revised this gist Feb 18, 2026. 1 changed file with 4 additions and 12 deletions.
    16 changes: 4 additions & 12 deletions tmux_linux.conf
    Original file line number Diff line number Diff line change
    @@ -100,12 +100,6 @@ bind -n M-Right select-pane -R
    bind -n M-Up select-pane -U
    bind -n M-Down select-pane -D

    # Prefix + vim-style fallback
    bind h select-pane -L
    bind j select-pane -D
    bind k select-pane -U
    bind l select-pane -R

    # ─── Pane Resizing (no prefix needed) ───────────────────────────────────────
    bind -n S-Left resize-pane -L 3
    bind -n S-Right resize-pane -R 3
    @@ -173,17 +167,15 @@ bind s choose-tree -sZ
    bind N command-prompt -p "new session:" "new-session -s '%%'"

    # ─── Copy Mode ──────────────────────────────────────────────────────────────
    setw -g mode-keys vi
    set -g mode-style "bg=#2a2a4a,fg=#e0e0e0"

    bind v copy-mode

    # macOS clipboard integration (pbcopy)
    bind -T copy-mode-vi v send-keys -X begin-selection
    bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
    bind -T copy-mode-vi r send-keys -X rectangle-toggle
    bind -T copy-mode-vi Escape send-keys -X cancel
    bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
    bind -T copy-mode v send-keys -X begin-selection
    bind -T copy-mode y send-keys -X copy-pipe-and-cancel "pbcopy"
    bind -T copy-mode Escape send-keys -X cancel
    bind -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"

    # Custom IJKL navigation (copy-mode)
    bind-key -T copy-mode 'i' send-keys -X cursor-up
  17. trungnt13 revised this gist Feb 18, 2026. No changes.
  18. trungnt13 revised this gist Feb 18, 2026. No changes.
  19. trungnt13 revised this gist Feb 18, 2026. 1 changed file with 19 additions and 5 deletions.
    24 changes: 19 additions & 5 deletions tmux_linux.conf
    Original file line number Diff line number Diff line change
    @@ -80,11 +80,19 @@ set -g prefix C-b
    set -g prefix2 C-a
    bind C-a send-prefix -2

    # ─── Pane Splitting ─────────────────────────────────────────────────────────
    bind | split-window -h -c "#{pane_current_path}"
    bind \\ split-window -h -c "#{pane_current_path}"
    bind - split-window -v -c "#{pane_current_path}"
    bind _ split-window -v -c "#{pane_current_path}"
    # ─── Pane Splitting (max 4 panes) ────────────────────────────────────────────
    bind | if-shell "[ #{window_panes} -lt 4 ]" \
    "split-window -h -c '#{pane_current_path}'" \
    "display-message 'max 4 panes'"
    bind \\ if-shell "[ #{window_panes} -lt 4 ]" \
    "split-window -h -c '#{pane_current_path}'" \
    "display-message 'max 4 panes'"
    bind - if-shell "[ #{window_panes} -lt 4 ]" \
    "split-window -v -c '#{pane_current_path}'" \
    "display-message 'max 4 panes'"
    bind _ if-shell "[ #{window_panes} -lt 4 ]" \
    "split-window -v -c '#{pane_current_path}'" \
    "display-message 'max 4 panes'"

    # ─── Pane Navigation (no prefix needed) ─────────────────────────────────────
    bind -n M-Left select-pane -L
    @@ -122,6 +130,12 @@ bind -n M-8 select-window -t 8
    bind -n M-9 select-window -t 9
    bind c new-window -c "#{pane_current_path}"

    # ─── Pane Direct Select (Prefix + 1/2/3/) ────────────────────────────────────
    bind 1 select-pane -t 1
    bind 2 select-pane -t 2
    bind 3 select-pane -t 3
    bind 4 select-pane -t 4

    # ─── Zoom & Layout ──────────────────────────────────────────────────────────
    bind Space next-layout
    bind = select-layout tiled # equal grid — best for 3–4 agents
  20. trungnt13 revised this gist Feb 18, 2026. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions tmux_linux.conf
    Original file line number Diff line number Diff line change
    @@ -52,6 +52,8 @@ set -g allow-rename off # keep stable window names
    set -g set-titles on
    set -g set-titles-string "#S:#I — #W"
    set -g aggressive-resize on # resize to smallest *active* client
    setw -g main-pane-width 55% # main-vertical: main pane takes 55% of width
    setw -g main-pane-height 55% # main-horizontal: main pane takes 55% of height

    # ─── Appearance ──────────────────────────────────────────────────────────────
    set -g window-style "bg=#0a0a0a"
  21. trungnt13 revised this gist Feb 18, 2026. No changes.
  22. trungnt13 revised this gist Feb 18, 2026. 1 changed file with 19 additions and 28 deletions.
    47 changes: 19 additions & 28 deletions tmux_linux.conf
    Original file line number Diff line number Diff line change
    @@ -1,20 +1,13 @@
    # tmux.conf for Linux — multi-agent coding sessions
    # tmux.conf for macOS (Apple Silicon) — multi-agent coding sessions
    # v3 — 17Feb26
    #
    # ╭─────────────────────── QUICK START ───────────────────────╮
    # │ │
    # │ INSTALL: │
    # │ sudo apt install tmux # Debian/Ubuntu │
    # │ sudo dnf install tmux # Fedora │
    # │ sudo pacman -S tmux # Arch │
    # │ cp tmux_linux.conf ~/.tmux.conf │
    # │ brew install tmux │
    # │ cp tmux_macos.conf ~/.tmux.conf │
    # │ tmux source-file ~/.tmux.conf # reload if running │
    # │ │
    # │ CLIPBOARD DEPS (pick one): │
    # │ sudo apt install xclip # X11 │
    # │ sudo apt install xsel # X11 (alternative) │
    # │ sudo apt install wl-clipboard # Wayland │
    # │ │
    # │ LAUNCH MULTI-AGENT SESSION: │
    # │ tmux new -s work # new session │
    # │ Prefix = Ctrl-b (or Ctrl-a) │
    @@ -44,18 +37,13 @@
    # │ │
    # ╰───────────────────────────────────────────────────────────╯

    # ─── Clipboard Helper ───────────────────────────────────────────────────────
    # Auto-detect: Wayland → wl-copy, X11 → xclip, fallback → xsel
    # Used by copy-mode bindings below
    CLIP_CMD='if [ -n "$WAYLAND_DISPLAY" ]; then wl-copy; elif command -v xclip >/dev/null 2>&1; then xclip -selection clipboard; else xsel --clipboard --input; fi'

    # ─── Core ────────────────────────────────────────────────────────────────────
    set -g history-limit 250000 # agents produce lots of output
    set -g default-terminal "tmux-256color"
    set -sa terminal-overrides ",xterm-256color:Tc" # 24-bit color passthrough
    set -g escape-time 10 # fast ESC (critical for vim/neovim)
    set -g focus-events on # let apps detect focus changes
    set -g set-clipboard on # OSC-52 clipboard passthrough
    set -g set-clipboard on # OSC-52 clipboard → macOS pasteboard
    set -g mouse on # click panes, scroll, resize
    set -g base-index 1 # windows start at 1
    set -g pane-base-index 1 # panes start at 1
    @@ -72,7 +60,8 @@ set -g pane-border-style "fg=#333333,bg=default"
    set -g pane-active-border-style "fg=#ff6600,bg=default"
    set -g pane-border-lines heavy # thicker borders — easy to see splits

    # Status bar — compact, top-aligned for max terminal space
    # Status bar — hidden (zen mode); toggle with Prefix+B
    set -g status off
    set -g status-position top
    set -g status-interval 5
    set -g status-style "bg=#1a1a2e,fg=#e0e0e0"
    @@ -139,18 +128,20 @@ bind E select-layout even-vertical # stacked rows

    # ─── Quick Agent Layouts ────────────────────────────────────────────────────
    # Prefix + Alt-2: 2 side-by-side panes
    bind M-2 \
    bind 8 \
    split-window -h -c "#{pane_current_path}" \;\
    select-layout even-horizontal

    # Prefix + Alt-3: 1 main left + 2 stacked right
    bind M-3 \
    split-window -h -c "#{pane_current_path}" \;\
    split-window -v -c "#{pane_current_path}" \;\
    select-layout main-vertical
    # Prefix+9: toggle between main-vertical (1 big + 2 stacked) and even-horizontal (3 columns)
    # Creates panes first if fewer than 3 exist
    bind 9 if-shell "[ #{window_panes} -lt 3 ]" \
    "split-window -h -c '#{pane_current_path}' \; split-window -v -c '#{pane_current_path}' \; select-layout main-vertical" \
    "if-shell 'echo \"#{window_layout}\" | grep -q ^main-vertical' \
    'select-layout even-horizontal' \
    'select-layout main-vertical'"

    # Prefix + Alt-4: 2×2 grid
    bind M-4 \
    bind 0 \
    split-window -h -c "#{pane_current_path}" \;\
    split-window -v -c "#{pane_current_path}" \;\
    select-pane -t 1 \;\
    @@ -171,12 +162,12 @@ set -g mode-style "bg=#2a2a4a,fg=#e0e0e0"

    bind v copy-mode

    # Linux clipboard integration (auto-detect X11/Wayland)
    # macOS clipboard integration (pbcopy)
    bind -T copy-mode-vi v send-keys -X begin-selection
    bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "$CLIP_CMD"
    bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
    bind -T copy-mode-vi r send-keys -X rectangle-toggle
    bind -T copy-mode-vi Escape send-keys -X cancel
    bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "$CLIP_CMD"
    bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"

    # Custom IJKL navigation (copy-mode)
    bind-key -T copy-mode 'i' send-keys -X cursor-up
    @@ -190,7 +181,7 @@ bind-key -T copy-mode ',' send-keys -X page-down
    bind-key -T copy-mode '[' send-keys -X begin-selection
    bind-key -T copy-mode 'Space' send-keys -X begin-selection
    bind-key -T copy-mode ']' send-keys -X clear-selection
    bind-key -T copy-mode Enter send-keys -X copy-pipe-and-cancel "$CLIP_CMD"
    bind-key -T copy-mode Enter send-keys -X copy-pipe-and-cancel "pbcopy"

    # Scroll into copy mode with mouse wheel
    bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" \
  23. trungnt13 revised this gist Feb 18, 2026. 1 changed file with 20 additions and 8 deletions.
    28 changes: 20 additions & 8 deletions tmux_linux.conf
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,20 @@
    # tmux.conf for macOS (Apple Silicon) — multi-agent coding sessions
    # tmux.conf for Linux — multi-agent coding sessions
    # v3 — 17Feb26
    #
    # ╭─────────────────────── QUICK START ───────────────────────╮
    # │ │
    # │ INSTALL: │
    # │ brew install tmux │
    # │ sudo apt install tmux # Debian/Ubuntu │
    # │ sudo dnf install tmux # Fedora │
    # │ sudo pacman -S tmux # Arch │
    # │ cp tmux_linux.conf ~/.tmux.conf │
    # │ tmux source-file ~/.tmux.conf # reload if running │
    # │ │
    # │ CLIPBOARD DEPS (pick one): │
    # │ sudo apt install xclip # X11 │
    # │ sudo apt install xsel # X11 (alternative) │
    # │ sudo apt install wl-clipboard # Wayland │
    # │ │
    # │ LAUNCH MULTI-AGENT SESSION: │
    # │ tmux new -s work # new session │
    # │ Prefix = Ctrl-b (or Ctrl-a) │
    @@ -37,21 +44,26 @@
    # │ │
    # ╰───────────────────────────────────────────────────────────╯

    # ─── Clipboard Helper ───────────────────────────────────────────────────────
    # Auto-detect: Wayland → wl-copy, X11 → xclip, fallback → xsel
    # Used by copy-mode bindings below
    CLIP_CMD='if [ -n "$WAYLAND_DISPLAY" ]; then wl-copy; elif command -v xclip >/dev/null 2>&1; then xclip -selection clipboard; else xsel --clipboard --input; fi'

    # ─── Core ────────────────────────────────────────────────────────────────────
    set -g history-limit 250000 # agents produce lots of output
    set -g default-terminal "tmux-256color"
    set -sa terminal-overrides ",xterm-256color:Tc" # 24-bit color passthrough
    set -g escape-time 10 # fast ESC (critical for vim/neovim)
    set -g focus-events on # let apps detect focus changes
    set -g set-clipboard on # OSC-52 clipboard → macOS pasteboard
    set -g set-clipboard on # OSC-52 clipboard passthrough
    set -g mouse on # click panes, scroll, resize
    set -g base-index 1 # windows start at 1
    set -g pane-base-index 1 # panes start at 1
    set -g renumber-windows on # keep window numbers sequential
    set -g allow-rename off # keep stable window names
    set -g set-titles on
    set -g set-titles-string "#S:#I — #W"
    setw -g aggressive-resize on # resize to smallest *active* client
    set -g aggressive-resize on # resize to smallest *active* client

    # ─── Appearance ──────────────────────────────────────────────────────────────
    set -g window-style "bg=#0a0a0a"
    @@ -159,12 +171,12 @@ set -g mode-style "bg=#2a2a4a,fg=#e0e0e0"

    bind v copy-mode

    # macOS clipboard integration (pbcopy)
    # Linux clipboard integration (auto-detect X11/Wayland)
    bind -T copy-mode-vi v send-keys -X begin-selection
    bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
    bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "$CLIP_CMD"
    bind -T copy-mode-vi r send-keys -X rectangle-toggle
    bind -T copy-mode-vi Escape send-keys -X cancel
    bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
    bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "$CLIP_CMD"

    # Custom IJKL navigation (copy-mode)
    bind-key -T copy-mode 'i' send-keys -X cursor-up
    @@ -178,7 +190,7 @@ bind-key -T copy-mode ',' send-keys -X page-down
    bind-key -T copy-mode '[' send-keys -X begin-selection
    bind-key -T copy-mode 'Space' send-keys -X begin-selection
    bind-key -T copy-mode ']' send-keys -X clear-selection
    bind-key -T copy-mode Enter send-keys -X copy-pipe-and-cancel "pbcopy"
    bind-key -T copy-mode Enter send-keys -X copy-pipe-and-cancel "$CLIP_CMD"

    # Scroll into copy mode with mouse wheel
    bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" \
  24. trungnt13 revised this gist Feb 17, 2026. No changes.
  25. trungnt13 revised this gist Feb 17, 2026. 1 changed file with 177 additions and 17 deletions.
    194 changes: 177 additions & 17 deletions tmux_linux.conf
    Original file line number Diff line number Diff line change
    @@ -1,20 +1,172 @@
    # 09Sep23 v1
    # https://gist.githubusercontent.com/trungnt13/34a8b101ab7fe14f7f0f194d1f63ad6c/raw/ea9293953796d78b8b93e67e046a5583c6cc6d39/tmux_linux.conf
    # 09Sep23 v2
    # https://gist.githubusercontent.com/trungnt13/34a8b101ab7fe14f7f0f194d1f63ad6c/raw/51dc5214e47d648039dffe83908e603ab07bf9c2/tmux_linux.conf
    set -g history-limit 100000

    ## Change background and border of active pane
    set-option -g pane-border-style fg=default,bg=default
    set-option -g pane-active-border-style fg=red,bg=default

    set-option -g default-terminal "screen-256color"
    set -g window-style "bg=black"
    # tmux.conf for macOS (Apple Silicon) — multi-agent coding sessions
    # v3 — 17Feb26
    #
    # ╭─────────────────────── QUICK START ───────────────────────╮
    # │ │
    # │ INSTALL: │
    # │ brew install tmux │
    # │ cp tmux_linux.conf ~/.tmux.conf │
    # │ tmux source-file ~/.tmux.conf # reload if running │
    # │ │
    # │ LAUNCH MULTI-AGENT SESSION: │
    # │ tmux new -s work # new session │
    # │ Prefix = Ctrl-b (or Ctrl-a) │
    # │ │
    # │ QUICK LAYOUTS (Prefix + key): │
    # │ Alt-2 → 2 side-by-side panes (2 agents) │
    # │ Alt-3 → 1 main + 2 stacked (3 agents) │
    # │ Alt-4 → 2×2 grid (4 agents) │
    # │ = → re-tile all panes evenly │
    # │ │
    # │ NAVIGATE PANES: │
    # │ Alt + Arrow → jump between panes (no prefix) │
    # │ Shift + Arrow → resize panes (no prefix) │
    # │ Alt + 1-9 → jump to window N (no prefix) │
    # │ z → zoom/unzoom current pane │
    # │ │
    # │ SPLIT & MANAGE: │
    # │ | or \ → vertical split - or _ → horizontal │
    # │ S → sync input to ALL panes (toggle) │
    # │ X → kill pane (no confirm) │
    # │ r → reload this config │
    # │ │
    # │ CLAUDE CODE AGENT TEAMS: │
    # │ Start claude inside tmux → auto split-pane mode │
    # │ teammateMode "tmux" in settings.json for split panes │
    # │ Click any pane to interact with that teammate │
    # │ │
    # ╰───────────────────────────────────────────────────────────╯

    # ─── Core ────────────────────────────────────────────────────────────────────
    set -g history-limit 250000 # agents produce lots of output
    set -g default-terminal "tmux-256color"
    set -sa terminal-overrides ",xterm-256color:Tc" # 24-bit color passthrough
    set -g escape-time 10 # fast ESC (critical for vim/neovim)
    set -g focus-events on # let apps detect focus changes
    set -g set-clipboard on # OSC-52 clipboard → macOS pasteboard
    set -g mouse on # click panes, scroll, resize
    set -g base-index 1 # windows start at 1
    set -g pane-base-index 1 # panes start at 1
    set -g renumber-windows on # keep window numbers sequential
    set -g allow-rename off # keep stable window names
    set -g set-titles on
    set -g set-titles-string "#S:#I — #W"
    setw -g aggressive-resize on # resize to smallest *active* client

    # ─── Appearance ──────────────────────────────────────────────────────────────
    set -g window-style "bg=#0a0a0a"
    set -g window-active-style "bg=#000000"
    set -g pane-border-style "fg=#333333,bg=default"
    set -g pane-active-border-style "fg=#ff6600,bg=default"
    set -g pane-border-lines heavy # thicker borders — easy to see splits

    # Status bar — compact, top-aligned for max terminal space
    set -g status-position top
    set -g status-interval 5
    set -g status-style "bg=#1a1a2e,fg=#e0e0e0"
    set -g status-left-length 30
    set -g status-right-length 60
    set -g status-left "#[fg=#00ff88,bold] #S #[fg=#555555]│ "
    set -g status-right "#[fg=#555555]│ #[fg=#88aaff]#{pane_current_command} #[fg=#555555]│ #[fg=#aaaaaa]%H:%M "
    setw -g window-status-format "#[fg=#666666] #I:#W "
    setw -g window-status-current-format "#[fg=#ff6600,bold] #I:#W#{?window_zoomed_flag, Z,} "
    set -g message-style "bg=#1a1a2e,fg=#ff6600,bold"

    # ─── Prefix ─────────────────────────────────────────────────────────────────
    set -g prefix C-b
    set -g prefix2 C-a
    bind C-a send-prefix -2

    # ─── Pane Splitting ─────────────────────────────────────────────────────────
    bind | split-window -h -c "#{pane_current_path}"
    bind \\ split-window -h -c "#{pane_current_path}"
    bind - split-window -v -c "#{pane_current_path}"
    bind _ split-window -v -c "#{pane_current_path}"

    # ─── Pane Navigation (no prefix needed) ─────────────────────────────────────
    bind -n M-Left select-pane -L
    bind -n M-Right select-pane -R
    bind -n M-Up select-pane -U
    bind -n M-Down select-pane -D

    # Prefix + vim-style fallback
    bind h select-pane -L
    bind j select-pane -D
    bind k select-pane -U
    bind l select-pane -R

    # ─── Pane Resizing (no prefix needed) ───────────────────────────────────────
    bind -n S-Left resize-pane -L 3
    bind -n S-Right resize-pane -R 3
    bind -n S-Up resize-pane -U 2
    bind -n S-Down resize-pane -D 2

    # Fine-grained with prefix
    bind -r H resize-pane -L 5
    bind -r J resize-pane -D 5
    bind -r K resize-pane -U 5
    bind -r L resize-pane -R 5

    # ─── Window Navigation (no prefix needed) ───────────────────────────────────
    bind -n M-1 select-window -t 1
    bind -n M-2 select-window -t 2
    bind -n M-3 select-window -t 3
    bind -n M-4 select-window -t 4
    bind -n M-5 select-window -t 5
    bind -n M-6 select-window -t 6
    bind -n M-7 select-window -t 7
    bind -n M-8 select-window -t 8
    bind -n M-9 select-window -t 9
    bind c new-window -c "#{pane_current_path}"

    ### copy-mode
    # ─── Zoom & Layout ──────────────────────────────────────────────────────────
    bind Space next-layout
    bind = select-layout tiled # equal grid — best for 3–4 agents
    bind + select-layout even-horizontal # side-by-side columns
    bind E select-layout even-vertical # stacked rows

    # Set custom key bindings for copy mode
    # ─── Quick Agent Layouts ────────────────────────────────────────────────────
    # Prefix + Alt-2: 2 side-by-side panes
    bind M-2 \
    split-window -h -c "#{pane_current_path}" \;\
    select-layout even-horizontal

    # Prefix + Alt-3: 1 main left + 2 stacked right
    bind M-3 \
    split-window -h -c "#{pane_current_path}" \;\
    split-window -v -c "#{pane_current_path}" \;\
    select-layout main-vertical

    # Prefix + Alt-4: 2×2 grid
    bind M-4 \
    split-window -h -c "#{pane_current_path}" \;\
    split-window -v -c "#{pane_current_path}" \;\
    select-pane -t 1 \;\
    split-window -v -c "#{pane_current_path}" \;\
    select-layout tiled

    # ─── Sync Input (broadcast to all panes) ────────────────────────────────────
    bind S setw synchronize-panes \; \
    display-message "sync: #{?synchronize-panes,ON,OFF}"

    # ─── Session Management ─────────────────────────────────────────────────────
    bind s choose-tree -sZ
    bind N command-prompt -p "new session:" "new-session -s '%%'"

    # ─── Copy Mode ──────────────────────────────────────────────────────────────
    setw -g mode-keys vi
    set -g mode-style "bg=#2a2a4a,fg=#e0e0e0"

    bind v copy-mode

    # macOS clipboard integration (pbcopy)
    bind -T copy-mode-vi v send-keys -X begin-selection
    bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
    bind -T copy-mode-vi r send-keys -X rectangle-toggle
    bind -T copy-mode-vi Escape send-keys -X cancel
    bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"

    # Custom IJKL navigation (copy-mode)
    bind-key -T copy-mode 'i' send-keys -X cursor-up
    bind-key -T copy-mode 'k' send-keys -X cursor-down
    bind-key -T copy-mode 'j' send-keys -X cursor-left
    @@ -23,10 +175,18 @@ bind-key -T copy-mode 'u' send-keys -X start-of-line
    bind-key -T copy-mode 'o' send-keys -X end-of-line
    bind-key -T copy-mode '.' send-keys -X page-up
    bind-key -T copy-mode ',' send-keys -X page-down

    # selection and clipboard
    bind-key -T copy-mode '[' send-keys -X begin-selection
    bind-key -T copy-mode 'Space' send-keys -X begin-selection
    bind-key -T copy-mode ']' send-keys -X clear-selection
    bind-key -T copy-mode Enter send-keys -X copy-pipe-and-cancel "pbcopy"

    # Scroll into copy mode with mouse wheel
    bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" \
    "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"

    bind-key -T copy-mode Enter send-keys -X copy-selection-and-cancel
    # ─── Utility ────────────────────────────────────────────────────────────────
    bind r source-file ~/.tmux.conf \; display-message "config reloaded"
    bind X kill-pane
    bind Q confirm-before -p "kill window #W? (y/n)" kill-window
    bind m select-pane -m
    bind M swap-pane
  26. trungnt13 revised this gist Feb 17, 2026. No changes.
  27. trungnt13 revised this gist Sep 9, 2023. No changes.
  28. trungnt13 revised this gist Sep 9, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion tmux_linux.conf
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    # 09Sep23 v1
    # https://gist.githubusercontent.com/trungnt13/34a8b101ab7fe14f7f0f194d1f63ad6c/raw/ea9293953796d78b8b93e67e046a5583c6cc6d39/tmux_linux.conf
    # 09Sep23 v2
    # https://gist.githubusercontent.com/trungnt13/34a8b101ab7fe14f7f0f194d1f63ad6c/raw/ea9293953796d78b8b93e67e046a5583c6cc6d39/tmux_linux.conf
    # https://gist.githubusercontent.com/trungnt13/34a8b101ab7fe14f7f0f194d1f63ad6c/raw/51dc5214e47d648039dffe83908e603ab07bf9c2/tmux_linux.conf
    set -g history-limit 100000

    ## Change background and border of active pane
  29. trungnt13 revised this gist Sep 9, 2023. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions tmux_linux.conf
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # 09Sep23
    # 09Sep23 v1
    # https://gist.githubusercontent.com/trungnt13/34a8b101ab7fe14f7f0f194d1f63ad6c/raw/ea9293953796d78b8b93e67e046a5583c6cc6d39/tmux_linux.conf
    # 09Sep23
    # 09Sep23 v2
    # https://gist.githubusercontent.com/trungnt13/34a8b101ab7fe14f7f0f194d1f63ad6c/raw/ea9293953796d78b8b93e67e046a5583c6cc6d39/tmux_linux.conf
    set -g history-limit 100000

  30. trungnt13 revised this gist Sep 9, 2023. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions tmux_linux.conf
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    # 09Sep23
    # https://gist.githubusercontent.com/trungnt13/34a8b101ab7fe14f7f0f194d1f63ad6c/raw/ea9293953796d78b8b93e67e046a5583c6cc6d39/tmux_linux.conf
    # 09Sep23
    # https://gist.githubusercontent.com/trungnt13/34a8b101ab7fe14f7f0f194d1f63ad6c/raw/ea9293953796d78b8b93e67e046a5583c6cc6d39/tmux_linux.conf
    set -g history-limit 100000

    ## Change background and border of active pane