In emacs, you split a window with C-x 2 (one above the other) or C-x 3 (one next to the other).

How can I get the same key bindings in tmux?

Also, once a window is split, in emacs you cycle through them with C-x o. Can I configure tmux to use the same key?

  • Have you read the man page for tmux? It should be obvious what to do. Unfortunately if you do it, then C-x stops working as a prefix key in Emacs because tmux will interpret it instead. – Kyle Jones Nov 7 '13 at 23:42
  • It would be nice if there were a tmux command I could use to disable those keys just for the one window in which I run emacs. Alternatively, I'd be happy to use C-b C-x 2 instead of the normal C-x 2 to split windows. – Frank Nov 8 '13 at 23:42

Have a look at the must read at http://pragprog.com/book/bhtmux/tmux; you'll get anything you need Further on, try out this:

# Setting the prefix from C-b to C-d 
# START:prefix
set -g prefix C-d 
# END:prefix 

# Ensure that we can send Ctrl-A to other apps 
bind C-d send-prefix 

# Free the original Ctrl-b prefix keybinding unbind C-b
unbind C-b

bind | split-window -h
bind _ split-window -v

And this for moving between panes:

bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

Both from the previous reference and the man page.

  • Much better now, thanks @Jason, I'll do my best next time. – csantosb Nov 23 '13 at 21:58
  • Sorry, I don't understand how this answers my questions and would give me C-x 2 and C-x 3 for splitting? – Frank Nov 24 '13 at 6:16
  • Put this code in your config file along with whatever you need – csantosb Nov 25 '13 at 16:23
  • 2
    @csantosb - I don't think those keys are what @frank is looking for. Emacs splits with Ctrl-x 2, and switches with Ctrl-x o. – Ken Williams Aug 10 '15 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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