i have the following code in my tmux.conf, which copies the selection in copy-mode and sends it to another pane where i have vim opened.
bind-key -t vi-copy o copy-selection
bind-key -t vi-copy o copy-pipe "xclip -sel clip -i"
bind-key -t vi-copy o copy-pipe "xargs -I{} tmux send-keys -t 1 ';call OpenTestFile(\"{}\")' Enter && tmux select-pane -t 1"
I think, the xargs -I{}
command triggers, that every line of the selection is send to that pane one by one. So if i select 6 lines, tmux will send these 6 lines to the pane with vim in it.
But i only want to have one call of send-keys with the whole selected string send to the pane.
So, is there another tool, that reads the standard input and sends it to tmux send-keys
or can i modify the xargs -I{}
part, that it executes only once with all the selected lines?