Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In the tmux application, how can I map ctrl-a, o (window cycle) to ctrl-a, w ?

share|improve this question

3 Answers 3

From the tmux command line:

bind w rotate-window

or from the shell

tmux bind w rotate-window
share|improve this answer
    
This is useful...+1... but not quite what I wanted. This actually switches windows around as well. I would like to remap the ctrl-b,o option that just switches focus without switching the whole split around. –  Michael Durrant Jun 21 '12 at 18:07
    
kinda like ctrl-b [arrow keys] do –  Michael Durrant Jun 21 '12 at 18:08
    
Sorry, "cycle window" make me think of the command bound to C-o instead of o. Like @ChrisJohson posted, you want the 'select-pane' command. –  chepner Jun 23 '12 at 17:30

By default, Prefixo is bound to the tmux command select-pane -t :.+.
If you want Prefixw to execute the same command, then do this (e.g. in your .tmux.conf):

bind-key w select-pane -t :.+

Note: This will override the default Prefix+w command (choose-window).

:.+ as a “target-pane” is a way of referring to the next pane in the current window of the current session. See the manpage description of “target-pane”.


By the way, you can inspect your current bindings with the list-keys command (by default, bound to Prefix?, or via Prefix:list-keys, or (e.g.) tmux list-keys | less in a shell). You could use the output of list-keys to determine the original binding of Prefixo.

share|improve this answer
up vote 0 down vote accepted

For now I am using ctrl-a,q,#

ctrl-a I already mapped to ctrl-b

This was the three keys strokes AFTER ctrl are a,q,0 or a,q,1 or a,q,2, etc.

These keys (except 0) are right next to each other on the keyboard for maximum ease of use!

If I could just force tmux to do 1 based counting instead of 0....

share|improve this answer
2  
set -g base-index 1 ..... more tmux tweaks you might like –  Jeremy W Jun 21 '12 at 19:54
1  
pane-base-index changes the starting index for panes (base-index is for window indices). –  Chris Johnsen Jun 22 '12 at 2:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.