Here's how I do it:

# move x clipboard into tmux paste buffer
bind C-p run "tmux set-buffer \"$(xclip -o -selection clipboard)\";
tmux paste-buffer"
# move tmux copy buffer into x clipboard
bind C-y run "tmux show-buffer | xclip -i -selection clipboard"

On Tue, Mar 12, 2013 at 1:13 PM, James Jong <ribonucle...@gmail.com> wrote:
> I am running latest version of tmux (1.7) and xclip (0.12) installed in the
> system. I would like to define Emacs-like keyboard bindings in my
> `.tmux.conf` to be able to copy (M-w) and paste (C-y) from/to the copy
> buffer to the clipboard.
>
> I found some code [1] for copying the entire buffer to the clipboard (and
> viceversa), but I can't figure out how to modify it to make the solution
> proposed in the most voted answer to copy and paste a selection:
>
>     # Copy  X clipboard into tmux paste buffer
>     bind C-y run "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer"
>
>     # Copy tmux buffer into x clipboard
>     bind M-w run "tmux save-buffer - | xclip -i"
>
>   [1]:
> http://unix.stackexchange.com/questions/15715/getting-tmux-to-copy-a-buffer-to-the-clipboard
>
> Any ideas? What is the best way to approach this?
>
> James
>
> ------------------------------------------------------------------------------
> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
> endpoint security space. For insight on selecting the right partner to
> tackle endpoint security challenges, access the full report.
> http://p.sf.net/sfu/symantec-dev2dev
> _______________________________________________
> tmux-users mailing list
> tmux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tmux-users
>

------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to