Closed ozars closed 5 years ago
Hi, thanks for your PR.
It seems #11 is more straight-forward
If they both addressing the same issue, I will merge #11 instead.
Please test the PR.
I've been using my fork smoothly since, but I will let you know after going through what I did why I did as it's been a while and I forgot.
Thank you for this useful plugin.
This PR allows copying tmux buffer to vim register where the vim instance running in the pane in which tmux buffer is modified, without any need of switching panes redundantly.
I needed to copy output of some commands run inside vim in the same pane with vim using tmux (as if I was using mouse). However, it didn't work as it did in different panes. I realized FocusLost is being called after tmux creates new buffer after it's done creating a new buffer to copy text in
<Prefix>[
mode. Therefore, FocusGain finds no difference between last buffer name and current buffer name. As a workaround, I kept track of the previous last buffer. See the inline comment and code for further information on how it works:https://github.com/ozars/vim-tmux-clipboard/blob/f0a1ca23f91377527d18514a239aad6510bb796e/plugin/vimtmuxclipboard.vim#L22-L31
I expanded tab characters to spaces in the first commit, I can revert this if it's an issue.
My vim version: