Commit Diff


commit - c1094bdbfbee5738278702a32b37c86ee2ef175f
commit + c359a176006cceeb61a84b10ebac8fe807051bd0
blob - 14d9eb640b1e22da44d9fe9ba97ada467a3a5bb2
blob + c554b2a324132c909665de04e70575023be91d60
--- .tmux.conf
+++ .tmux.conf
@@ -18,6 +18,16 @@ bind l select-pane -R
 bind-key -T copy-mode-vi 'v' send -X begin-selection
 bind-key -T copy-mode-vi 'y' send -X copy-selection
 
+# copy stuff
+set-option -g mouse on
+setw -g mode-keys vi
+
+if-shell "uname | grep -q Darwin" \
+  "bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'pbcopy'; \
+     bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'pbcopy'" \
+       "bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -selection clipboard'; \
+	  bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -selection clipboard'"
+
 bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
 
 # More comfortable prefix binding