From 074c8732f2c13d12439e336219f68cff2b4b3d1b Mon Sep 17 00:00:00 2001 From: Anton Volnuhin Date: Sat, 28 Mar 2026 13:20:07 +0300 Subject: [PATCH] more tmux copy mode configs: v starts selection, square back to C-v --- dot_gitconfig | 6 ++++++ dot_tmux.conf | 30 ++++++++++++++++++------------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/dot_gitconfig b/dot_gitconfig index 0fbb6d1..95a78b6 100644 --- a/dot_gitconfig +++ b/dot_gitconfig @@ -24,3 +24,9 @@ helper = /usr/local/share/gcm-core/git-credential-manager [credential "https://dev.azure.com"] useHttpPath = true +[credential "https://github.com"] + helper = + helper = !/opt/homebrew/bin/gh auth git-credential +[credential "https://gist.github.com"] + helper = + helper = !/opt/homebrew/bin/gh auth git-credential diff --git a/dot_tmux.conf b/dot_tmux.conf index ac2a4c3..f4cc979 100644 --- a/dot_tmux.conf +++ b/dot_tmux.conf @@ -13,29 +13,35 @@ bind C-a send-prefix -2 # reload configuration bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced' set -g default-terminal "tmux-256color" -set -s extended-keys on -set -s set-clipboard on +set -s set-clipboard external set -as terminal-features ",xterm-kitty:RGB" set -as terminal-features ",xterm-kitty:clipboard" set -as terminal-features ",xterm-kitty:extkeys" set -as terminal-features ",xterm:RGB" -set -as terminal-features ",xterm:clipboard" set -as terminal-features ",xterm-ghostty:RGB" set -as terminal-features ",xterm-ghostty:clipboard" set -as terminal-features ",xterm-ghostty:extkeys" set -as terminal-features ",xterm-256color:RGB" -set -as terminal-features ",xterm-256color:clipboard" -set -as terminal-features ",xterm-256color:extkeys" -set -as terminal-features ",screen-256color:clipboard" -set -as terminal-overrides ",xterm-256color:Ms=\\E]52;c;%p2%s\\007" -set -as terminal-overrides ",screen-256color:Ms=\\E]52;c;%p2%s\\007" +set -as terminal-overrides ",xterm-256color:Ms=\E]52;c;%p2%s\007" +set -as terminal-overrides ",screen-256color:Ms=\E]52;c;%p2%s\007" set -g allow-passthrough on set-window-option -g mode-keys vi -# Copy selections via tmux's OSC 52 clipboard support. -bind-key -T copy-mode-vi Enter send-keys -X copy-selection-and-cancel -bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel -bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-selection-and-cancel +# Copy selections by writing OSC 52 directly to the pane tty. This avoids the +# broken tmux load-buffer -w path seen under mosh, and works across macOS, +# Linux, FreeBSD, and OpenBSD with $HOME/.local/bin/yank-osc52. +bind-key -n MouseDrag1Pane if-shell -F '#{mouse_any_flag}' 'send-keys -M' 'copy-mode -M' +bind-key -n MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel '$HOME/.local/bin/yank-osc52 > #{pane_tty}' +bind-key -n DoubleClick1Pane select-pane -t = \; copy-mode -H \; send-keys -X select-word \; run-shell -b 'sleep 0.2; tmux send-keys -X -t "#{pane_id}" copy-pipe-and-cancel "$HOME/.local/bin/yank-osc52 > #{pane_tty}"' +bind-key -n TripleClick1Pane select-pane -t = \; copy-mode -H \; send-keys -X select-line \; run-shell -b 'sleep 0.2; tmux send-keys -X -t "#{pane_id}" copy-pipe-and-cancel "$HOME/.local/bin/yank-osc52 > #{pane_tty}"' +bind-key -T copy-mode-vi Space send-keys -X begin-selection +bind-key -T copy-mode-vi v send-keys -X begin-selection +bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle +bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel '$HOME/.local/bin/yank-osc52 > #{pane_tty}' +bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel '$HOME/.local/bin/yank-osc52 > #{pane_tty}' +bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel '$HOME/.local/bin/yank-osc52 > #{pane_tty}' +bind-key -T copy-mode-vi DoubleClick1Pane send-keys -X select-word \; run-shell -b 'sleep 0.2; tmux send-keys -X -t "#{pane_id}" copy-pipe-and-cancel "$HOME/.local/bin/yank-osc52 > #{pane_tty}"' +bind-key -T copy-mode-vi TripleClick1Pane send-keys -X select-line \; run-shell -b 'sleep 0.2; tmux send-keys -X -t "#{pane_id}" copy-pipe-and-cancel "$HOME/.local/bin/yank-osc52 > #{pane_tty}"' # Nova Config set -g @nova-nerdfonts true