summaryrefslogtreecommitdiff
path: root/core/tmux.conf
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-11-01 09:55:22 +0800
committerYour Name <you@example.com>2026-11-01 09:55:22 +0800
commit708e0c38fdcfd84a0028c4b261d77c4b2f5083df (patch)
tree9569b0dd0e9886ef1cea423b733c797461f1878e /core/tmux.conf
parent30b598c7d885b79e792232eff7146b524e31493b (diff)
core: one vimrc and tmux.conf for Mac and Linux
Diffstat (limited to 'core/tmux.conf')
-rw-r--r--core/tmux.conf40
1 files changed, 33 insertions, 7 deletions
diff --git a/core/tmux.conf b/core/tmux.conf
index 465641c..97084f1 100644
--- a/core/tmux.conf
+++ b/core/tmux.conf
@@ -1,15 +1,41 @@
1# True-color support regardless of what TERM the outer terminal/distro sets 1# Ctrl-b f: prompt for text, list windows whose name, pane title or pane contents match; Enter jumps
2set -g default-terminal "tmux-256color" 2# Ctrl-b w: tree of every window in every session; press f inside it to filter by name, Enter jumps
3set -ga terminal-overrides ",*256col*:Tc" 3# Ctrl-b s: tree of sessions (same tree, session view)
4 4# Ctrl-b p: go to the previous window (lower index, wraps); Ctrl-b n goes to the next one
5#
5# Vi mode for copy 6# Vi mode for copy
6setw -g mode-keys vi 7setw -g mode-keys vi
7 8
8# Mouse selection 9# Mouse selection
9set -g mouse on 10set -g mouse on
10 11
12# Persistent pane index labels (top-left of each pane's border)
13set -g pane-border-status top
14set -g pane-border-format "#P"
15
16# Explicitly swap current pane with a pane index you type in
17bind-key P command-prompt -p "swap with pane #:" "swap-pane -d -t '%%'"
18# Manual: :swap-pane -s <src> -t <dst>
19
20# Vim-style pane resizing (prefix + H/J/K/L), magnitude 1
21bind -r H resize-pane -L 1
22bind -r J resize-pane -D 1
23bind -r K resize-pane -U 1
24bind -r L resize-pane -R 1
25
11# v to start selection, y to yank (like vim) 26# v to start selection, y to yank (like vim)
12bind-key -T copy-mode-vi v send-keys -X begin-selection 27bind-key -T copy-mode-vi v send-keys -X begin-selection
13bind-key -T copy-mode-vi y send-keys -X copy-pipe-no-clear "openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 p.noml.ch 5023 >/dev/null 2>&1" 28# macOS: pbcopy. Linux: wl-copy/xclip when usable, else just drain (tmux's own
14bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-no-clear "openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 p.noml.ch 5023 >/dev/null 2>&1" 29# buffer + set-clipboard/OSC 52 still apply). Netcat send is the same on both.
15bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-no-clear "openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 p.noml.ch 5023 >/dev/null 2>&1" 30if-shell 'uname | grep -q Darwin' {
31 bind-key -T copy-mode-vi y send-keys -X copy-pipe-no-clear "bash -c 'tee >(pbcopy) | openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 p.noml.ch 5023 >/dev/null 2>&1'"
32 bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-no-clear "bash -c 'tee >(pbcopy) | openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 p.noml.ch 5023 >/dev/null 2>&1'"
33 bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-no-clear "bash -c 'tee >(pbcopy) | openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 p.noml.ch 5023 >/dev/null 2>&1'"
34} {
35 # Linux only: true-color regardless of what TERM the outer terminal/distro sets
36 set -g default-terminal "tmux-256color"
37 set -ga terminal-overrides ",*256col*:Tc"
38 bind-key -T copy-mode-vi y send-keys -X copy-pipe-no-clear "bash -c 'tee >(wl-copy 2>/dev/null || xclip -selection clipboard 2>/dev/null || cat >/dev/null) | openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 p.noml.ch 5023 >/dev/null 2>&1'"
39 bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-no-clear "bash -c 'tee >(wl-copy 2>/dev/null || xclip -selection clipboard 2>/dev/null || cat >/dev/null) | openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 p.noml.ch 5023 >/dev/null 2>&1'"
40 bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-no-clear "bash -c 'tee >(wl-copy 2>/dev/null || xclip -selection clipboard 2>/dev/null || cat >/dev/null) | openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 p.noml.ch 5023 >/dev/null 2>&1'"
41}