6

My hands get tired everytime clicking on Ctrl+b to activate tmux (prefix) and then q to switch between panes (pane numbers).

I want to map them to F1 and F2 respectively.

I understand I need to change something in the configuration file ~/.tmux.conf but I'm not sure what, especially how to refer to Function Keys while mapping, and go beyond prefix's definition, that's refer to prefix+q in this case.

Thanks in advance :)

1 Answer 1

3

Your question isn't clear as q by default prints the numbers of the panes, it doesn't switch between them...

Nevertheless, you can achieve what you are after with some simple binds: first, resetting the prefix key to q and then setting F1 to move to the left pane and F2 to the right. With that knowledge, you can adapt to whatever it is you are actually asking.

# set prefix key to ctrl+q
set -g prefix C-q
bind -n F1 select-pane -L
bind -n F2 select-pane -R

Note: I have included the -n switch which obviates the need for using prefix first, as you indicate you are tired of this. If you do want to hit the prefix before changing panes, just remove it.

5
  • Thanks, but what I actually want is to switch to <C-q> mode by clicking F2. I don't know it's "command" name (like select-pane) to bind to.
    – user86041
    Nov 19, 2016 at 3:41
  • I use <C-q> <s>as a preliminary step</s> to switch between panes :)
    – user86041
    Nov 19, 2016 at 3:42
  • You mean list-panes?
    – jasonwryan
    Nov 19, 2016 at 3:43
  • I just checked list-panes, no it's not what I want. I want the command that prints 0,1,2,3 on the screen. The command of Ctrl+Q. BTW thanks for -n it's really easy and useful switch :)
    – user86041
    Nov 19, 2016 at 3:48
  • It was display-panes. I found it on man. I'm accepting the answer.
    – user86041
    Nov 19, 2016 at 3:52

You must log in to answer this question.