Skip to content

Commit

Permalink
now copy paste in tmux is lovely <3
Browse files Browse the repository at this point in the history
  • Loading branch information
tonini committed Jun 2, 2015
1 parent 53ecade commit 1f326f5
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions tmux.conf
Expand Up @@ -8,10 +8,22 @@ set-option -g default-terminal "screen-256color"

set -g xterm-keys on

# Copy-paste integration
set-option -g default-command "reattach-to-user-namespace -l zsh"

bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
bind C-v run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
# Use vim keybindings in copy mode
setw -g mode-keys vi

# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"

# Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"

# Bind ']' to use pbpaste
bind ] run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"

set -g base-index 1
set -s escape-time 0
Expand All @@ -20,6 +32,14 @@ set -g visual-activity on
bind-key r source-file ~/.tmux.conf
bind-key C-a last-window

###########
## Mouse ##
###########

set-window-option -g mode-mouse on
set-option -g mouse-select-pane on
set-option -g mouse-select-window on

##############
## Status Bar
##############
Expand Down

0 comments on commit 1f326f5

Please sign in to comment.