Send yanks to Tmux clipboard (paste buffer)

1 Point

Cem Aksoylar Cem Aksoylar

8 months ago

Whenever a yank operation happens, also put the contents into the Tmux paste buffer to be used with prefix ].

if exists('$TMUX')
    augroup TmuxYank
        autocmd!
        autocmd TextYankPost * if v:event.operator ==# 'y' | call system('tmux set-buffer ' . shellescape(@0)) | endif
    augroup END
endif