Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions yank.tmux
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,26 @@ set_copy_mode_bindings() {
tmux bind-key -T copy-mode-vi "$(put_key)" send-keys -X copy-pipe-and-cancel "tmux paste-buffer -p"
tmux bind-key -T copy-mode-vi "$(yank_put_key)" send-keys -X copy-pipe-and-cancel "$copy_command; tmux paste-buffer -p"
tmux bind-key -T copy-mode-vi "$(yank_wo_newline_key)" send-keys -X "$(yank_action)" "$copy_wo_newline_command"
if [[ "$(yank_with_mouse)" == "on" ]]; then
tmux bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X "$(yank_action)" "$copy_command_mouse"
fi

tmux bind-key -T copy-mode "$(yank_key)" send-keys -X "$(yank_action)" "$copy_command"
tmux bind-key -T copy-mode "$(put_key)" send-keys -X copy-pipe-and-cancel "tmux paste-buffer -p"
tmux bind-key -T copy-mode "$(yank_put_key)" send-keys -X copy-pipe-and-cancel "$copy_command; tmux paste-buffer -p"
tmux bind-key -T copy-mode "$(yank_wo_newline_key)" send-keys -X "$(yank_action)" "$copy_wo_newline_command"

if [[ "$(yank_with_mouse)" == "on" ]]; then
tmux bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X "$(yank_action)" "$copy_command_mouse"
tmux bind-key -T copy-mode-vi SecondClick1Pane "select-pane ; send-keys -X select-word"
tmux bind-key -T copy-mode-vi DoubleClick1Pane send-keys -X "$(yank_action)" "$copy_command_mouse"
tmux bind-key -T copy-mode-vi TripleClick1Pane "send-keys -X select-line ; run-shell -d 0.3 ; send-keys -X \"$(yank_action)\" \"$copy_command_mouse\""

tmux bind-key -T copy-mode MouseDragEnd1Pane send-keys -X "$(yank_action)" "$copy_command_mouse"
tmux bind-key -T copy-mode SecondClick1Pane "select-pane ; send-keys -X select-word"
tmux bind-key -T copy-mode DoubleClick1Pane send-keys -X "$(yank_action)" "$copy_command_mouse"
tmux bind-key -T copy-mode TripleClick1Pane "send-keys -X select-line ; run-shell -d 0.3 ; send-keys -X \"$(yank_action)\" \"$copy_command_mouse\""

tmux bind-key -n SecondClick1Pane "select-pane -t = ; if-shell -F \"#{||:#{pane_in_mode},#{mouse_any_flag}}\" { send-keys -M } { copy-mode -eH ; send-keys -X select-word }"
tmux bind-key -n DoubleClick1Pane "if-shell -F \"#{||:#{pane_in_mode},#{mouse_any_flag}}\" { send-keys -M } { send-keys -X \"$(yank_action)\" \"$copy_command_mouse\" }"
tmux bind-key -n TripleClick1Pane "if-shell -F \"#{||:#{pane_in_mode},#{mouse_any_flag}}\" { send-keys -M } { send-keys -X select-line ; run-shell -d 0.3 ; send-keys -X \"$(yank_action)\" \"$copy_command_mouse\" }"
fi
else
tmux bind-key -t vi-copy "$(yank_key)" copy-pipe "$copy_command"
Expand Down