aboutsummaryrefslogtreecommitdiff
path: root/tmux
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2018-05-05 19:50:22 -0300
committerEuAndreh <eu@euandre.org>2018-05-05 19:50:22 -0300
commitdbf02e62db35a6f365e63b3869d82dfe20a9cfac (patch)
tree50816dd9600c8bb65a8192bd5b20a5b08f3f905b /tmux
parentAdd borg files (diff)
downloaddotfiles-dbf02e62db35a6f365e63b3869d82dfe20a9cfac.tar.gz
dotfiles-dbf02e62db35a6f365e63b3869d82dfe20a9cfac.tar.xz
Add custom copying commands for macOSxGNU/Linux
Diffstat (limited to 'tmux')
-rw-r--r--tmux/tmux-gnu-linux.conf3
-rw-r--r--tmux/tmux-macos.conf2
-rw-r--r--tmux/tmux.conf7
3 files changed, 7 insertions, 5 deletions
diff --git a/tmux/tmux-gnu-linux.conf b/tmux/tmux-gnu-linux.conf
new file mode 100644
index 0000000..592655a
--- /dev/null
+++ b/tmux/tmux-gnu-linux.conf
@@ -0,0 +1,3 @@
+bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe "xclip -selection clipbo
+ard -i" \; display-message "Copied! Long-live tmux!"
+bind-key y send-keys -X copy-pipe "xclip -selection clipboard -i" \; display-message "Copied system clipboard! Hooray! Long-live tmux!"
diff --git a/tmux/tmux-macos.conf b/tmux/tmux-macos.conf
new file mode 100644
index 0000000..6ce3dbd
--- /dev/null
+++ b/tmux/tmux-macos.conf
@@ -0,0 +1,2 @@
+bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe "pbcopy" \; display-message "Copied! Long-live tmux! It works on shitty macOS!"
+bind-key y send-keys -X copy-pipe "pbcopy" \; display-message "Copied system clipboard! Hooray! Long-live tmux!"
diff --git a/tmux/tmux.conf b/tmux/tmux.conf
index 9b38cbf..3ae1b39 100644
--- a/tmux/tmux.conf
+++ b/tmux/tmux.conf
@@ -12,10 +12,7 @@ bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
# Holy answer that properly implements copying from tmux!
# https://unix.stackexchange.com/a/349020/276661
-bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe "xclip -selection clipboard -i" \; display-message "Copied! Long-live tmux!"
-
-# Copy to clipboard after making selection with keyboard. Usefull for text that spans over a full pane and can't be selected with the mouse.
-bind-key y send-keys -X copy-pipe "xclip -selection clipboard -i" \; display-message "Copied system clipboard! Hooray! Long-live tmux!"
+if-shell "uname | grep -q Darwin" "source-file ~/.tmux-macos.conf" " source-file ~/.tmux-gnu-linux.conf"
# Moving around panes
bind-key h select-pane -L
@@ -61,4 +58,4 @@ set -g default-terminal screen-256color
set -sg escape-time 0
# Enable arrow key navigation
-set-option -gw xterm-keys on \ No newline at end of file
+set-option -gw xterm-keys on