From e29c029da66a2de43fee74988323a0e7491fb633 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Fri, 27 Jan 2023 01:38:08 +0100 Subject: tmux: add macOS copy-paste shortcuts --- %HOME%/.tmux.conf | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/%HOME%/.tmux.conf b/%HOME%/.tmux.conf index 7b91706..21db6d6 100644 --- a/%HOME%/.tmux.conf +++ b/%HOME%/.tmux.conf @@ -115,7 +115,6 @@ if-shell 'uname | grep -q -F CYGWIN' { bind-key -T copy-mode-vi '!' send-keys -X copy-pipe-and-cancel "tr -d '\n' > /dev/clipboard" bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'cat > /dev/clipboard' bind-key -T root MouseDown2Pane run 'cat /dev/clipboard | tmux load-buffer - && tmux paste-buffer' - bind-key ] run 'cat /dev/clipboard | tmux load-buffer - && tmux paste-buffer' } @@ -135,6 +134,18 @@ if-shell 'uname | grep -q -F Linux && which xsel' { bind-key ] run 'xsel -o | tmux load-buffer - && tmux paste-buffer' } +# 3. macOS + +if-shell 'uname | grep -q -F Darwin' { + bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'pbcopy' + bind-key -T copy-mode-vi Y send-keys -X copy-pipe-and-cancel 'tmux paste-buffer' + bind-key -T copy-mode-vi M-y send-keys -X copy-pipe-and-cancel 'pbpaste; tmux paste-buff' + bind-key -T copy-mode-vi '!' send-keys -X copy-pipe-and-cancel "tr -d '\n' | pbcopy" + bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'pbcopy' + bind-key -T root MouseDown2Pane run 'pbpaste | tmux load-buffer - && tmux paste-buffer' + bind-key ] run 'pbpaste | tmux load-buffer - && tmux paste-buffer' +} + # Appearance # ---------- -- cgit v1.2.3