Tmux: Difference between revisions
Jump to navigation
Jump to search
| Line 50: | Line 50: | ||
C2("set (set-option)") | C2("set (set-option)") | ||
C3("setw (set-window-option)") | C3("setw (set-window-option)") | ||
C4("if-shell") | |||
C5("run-shell") | |||
C6("set-environment") | |||
C7("display-message") | |||
C8("new-session") | |||
C9("new-window") | |||
C10("split-window") | |||
CONF --> C1 & C2 & C3 | CONF --> C1 & C2 & C3 | ||
</quickmmd> | </quickmmd> | ||
Revision as of 09:15, 3 September 2026
conf
# 開啟滑鼠支援(支援滾輪捲動、點擊選擇視窗與調整 Pane 大小)
set -g mouse on
# 視窗與 Pane 的編號從 1 開始(鍵盤上 1 比 0 好按許多)
set -g base-index 1
setw -g pane-base-index 1
# 增加歷史指令/輸出紀錄行數(預設約 2000 行,改為 10000 行)
set -g history-limit 10000
# 啟用 256 色與 True Color 全彩支援(解決 Vim/Neovim 顏色失真問題)
set -g default-terminal "screen-256color"
set-option -sa terminal-overrides ",xterm-256color:RGB"
# 將 Prefix 組合鍵改為 Ctrl + a(原本的 Ctrl + b 跨度太大)
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# 用 | 與 - 進行畫面切分,並自動維持在「當前工作目錄」
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# 使用 Vim 的 h, j, k, l 方向鍵切換分割畫面
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# 快速重載設定檔(按下 Prefix + r 即可生效)
bind r source-file ~/.tmux.conf \; display "設定檔已重新載入!"
# 在複製/捲動模式中使用 Vi 鍵盤操作習慣
setw -g mode-keys vi
# 綁定 v 開始選取、y 進行複製(類似 Vim)
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
commands
| File Path | /images/quickmmd/Tmux-tmux-cmds.svg |
|---|---|
| File Size | 16.88 KB |
| Last modified | 13:08:03 |
| Time of SVG loading | 1.72 second(s) |
| Time of SVG convertion | 0.00 second(s) |
| Cache Detected | No |
| MD5 of incoming syntax | 74d7607cd43a918304fff2e8b5ee9fa6 |
| MD5 of cached syntax | 027079ba9a1e2164d619a75217503aed |
| SVG Engine | Kroki API |
| Kroki API URL | http://kroki:8000 |
| Mermaid syntax Reference | https://mermaid.js.org/intro/syntax-reference.html |
| QuickMMD Version | 1.0.0 - About QuickMMD |
flowchart LR
CONF("~/.tmux.conf")
C1("bind | unbind")
C2("set (set-option)")
C3("setw (set-window-option)")
C4("if-shell")
C5("run-shell")
C6("set-environment")
C7("display-message")
C8("new-session")
C9("new-window")
C10("split-window")
CONF --> C1 & C2 & C3