SFbay007
SFbay007

Reputation: 2027

On tmux 2.4 how to enter copy-mode and start a search all in one go?

I am trying to bind F1 key to:

  1. Enter copy-mode
  2. Start a reverse search

The only thing I found online was:

bind-key F1 copy-mode \; send-key ?

However, that doesnt seem to work on tmux 2.4.

Is there a way to have it work on all tmux versions?

Upvotes: 2

Views: 608

Answers (1)

SFbay007
SFbay007

Reputation: 2027

This worked:

bind -n F1 copy-mode \; command-prompt -p "(search up)" "send -X search-backward \"%%%\""
bind -T copy-mode-vi F1 copy-mode \; command-prompt -p "(search up)" "send -X search-backward \"%%%\""

Upvotes: 2

Related Questions