aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-01-27 01:38:08 +0100
committerEgor Tensin <Egor.Tensin@gmail.com>2023-01-27 01:38:08 +0100
commite29c029da66a2de43fee74988323a0e7491fb633 (patch)
tree009b0f9870aa791605d1eb182259fc4bfe4f8218
parentssh: update my hosts (diff)
downloadlinux-home-e29c029da66a2de43fee74988323a0e7491fb633.tar.gz
linux-home-e29c029da66a2de43fee74988323a0e7491fb633.zip
tmux: add macOS copy-paste shortcuts
-rw-r--r--%HOME%/.tmux.conf13
1 files changed, 12 insertions, 1 deletions
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
# ----------