Skip to content

Instantly share code, notes, and snippets.

@inhies
Last active December 14, 2015 17:39
Show Gist options
  • Save inhies/5123925 to your computer and use it in GitHub Desktop.
Save inhies/5123925 to your computer and use it in GitHub Desktop.
Just some tmux notes

tmux notes

Note that I use Ctrl-a for my prefix k

  • C-a C-o Rotate panes
  • C-a q Show pane numbers
  • swap-pane -s source -t target Rearrange panes

Default Bindings

The default command key bindings are:

   C-b         Send the prefix key (C-b) through to the application.
   C-o         Rotate the panes in the current window forwards.
   C-z         Suspend the tmux client.
   !           Break the current pane out of the window.
   "           Split the current pane into two, top and bottom.
   #           List all paste buffers.
   $           Rename the current session.
   %           Split the current pane into two, left and right.
   &           Kill the current window.
   '           Prompt for a window index to select.
   ,           Rename the current window.
   -           Delete the most recently copied buffer of text.
   .           Prompt for an index to move the current window.
   0 to 9      Select windows 0 to 9.
   :           Enter the tmux command prompt.
   ;           Move to the previously active pane.
   =           Choose which buffer to paste interactively from a list.
   ?           List all key bindings.
   D           Choose a client to detach.
   [           Enter copy mode to copy text or view the history.
   ]           Paste the most recently copied buffer of text.
   c           Create a new window.
   d           Detach the current client.
   f           Prompt to search for text in open windows.
   i           Display some information about the current window.
   l           Move to the previously selected window.
   n           Change to the next window.
   o           Select the next pane in the current window.
   p           Change to the previous window.
   q           Briefly display pane indexes.
   r           Force redraw of the attached client.
   s           Select a new session for the attached client
               interactively.
   L           Switch the attached client back to the last session.
   t           Show the time.
   w           Choose the current window interactively.
   x           Kill the current pane.
   {           Swap the current pane with the previous pane.
   }           Swap the current pane with the next pane.
   ~           Show previous messages from tmux, if any.
   Page Up     Enter copy mode and scroll one page up.
   Up, Down
   Left, Right
               Change to the pane above, below, to the left, or to the
               right of the current pane.
   M-1 to M-5  Arrange panes in one of the five preset layouts: even-
               horizontal, even-vertical, main-horizontal, main-
               vertical, or tiled.
   M-n         Move to the next window with a bell or activity marker.
   M-o         Rotate the panes in the current window backwards.
   M-p         Move to the previous window with a bell or activity
               marker.
   C-Up, C-Down
   C-Left, C-Right
               Resize the current pane in steps of one cell.
   M-Up, M-Down
   M-Left, M-Right
               Resize the current pane in steps of five cells.

mode-keys settings

Function                     vi              emacs
Back to indentation          ^               M-m
Bottom of history            G               M-<
Clear selection              Escape          C-g
Copy selection               Enter           M-w
Cursor down                  j               Down
Cursor left                  h               Left
Cursor right                 l               Right
Cursor to bottom line        L
Cursor to middle line        M               M-r
Cursor to top line           H               M-R
Cursor up                    k               Up
Delete entire line           d               C-u
Delete/Copy to end of line   D               C-k
End of line                  $               C-e
Go to line                   :               g
Half page down               C-d             M-Down
Half page up                 C-u             M-Up
Jump forward                 f               f
Jump to forward              t
Jump backward                F               F
Jump to backward             T
Jump again                   ;               ;
Jump again in reverse        ,               ,
Next page                    C-f             Page down
Next space                   W
Next space, end of word      E
Next word                    w
Next word end                e               M-f
Paste buffer                 p               C-y
Previous page                C-b             Page up
Previous word                b               M-b
Previous space               B
Quit mode                    q               Escape
Rectangle toggle             v               R
Scroll down                  C-Down or C-e   C-Down
Scroll up                    C-Up or C-y     C-Up
Search again                 n               n
Search again in reverse      N               N
Search backward              ?               C-r
Search forward               /               C-s
Start of line                0               C-a
Start selection              Space           C-Space
Top of history               g               M->
Transpose chars                              C-t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment