コンテンツにスキップ

tmux

Zellij と並行して使える tmux の設定。prefix key の統一、vi-mode の copy、session の自動復元、カスタム status bar を含む。

prefix は Ctrl+q に変更している(Zellij と統一)。

Terminal window
unbind C-b
set -g prefix C-q
Key操作
Ctrl+h前の window
Ctrl+l次の window
Key操作
\右に分割
-下に分割
h/j/k/lpane 間のフォーカス移動
H/J/K/Lpane の resize
zpane zoom (全画面)
xpane を閉じる
Tab直前の window に切替
[copy mode に入る
?keybindings help popup
Key操作
v選択開始
ycopy (pbcopy 経由)
H行頭
L行末
Escapecancel
Key操作
p再生/一時停止
]次の曲
P前の曲

TPM (Tmux Plugin Manager) で管理。

Plugin説明
tmux-sensible安全な default 設定
tmux-yanksystem clipboard 連携
tmux-batterybattery 残量表示
tmux-cpuCPU usage 表示
tmux-weather天気情報
tmux-net-speednetwork speed 表示
tmux-resurrectsession の保存/復元
tmux-continuum自動 save (15 分間隔) と自動 restore
catppuccin/tmuxCatppuccin テーマ

tmux-resurrect と tmux-continuum で session を自動保存・復元する。

  • 15 分間隔で自動 save
  • tmux 起動時に自動 restore
  • vim/nvim の session も復元
  • pane の内容も保持
  • ssh, node, python, go, cargo などの process も復元対象

Catppuccin Mocha ベースの pill-style status bar。左に session 名、右に各種情報を表示する。

Item説明
Session 名左端に ghost icon 付き
Spotify再生中の曲名
Help iconclick で keybindings popup
天気気温と天気 icon
気圧hPa 表示
降水確率傘 icon 付き
Network接続状態
地震情報最新の地震速報
Battery残量
CPUusage %
時刻HH:MM

pill 型の window tab。active tab は青背景、inactive は暗い背景で表示。

theme-switch コマンドで切り替えると ~/.config/tmux/themes/current.conf が更新され、tmux のテーマも自動で変わる。

基本的な設定値。

項目
Default terminaltmux-256color
True colorRGB 対応
History limit50,000 行
Mouse有効
Base index1 (0 ではなく 1 始まり)
Shell/opt/homebrew/bin/zsh