Common tmux shortcut keys

Source: Internet
Author: User
Original article link
Server Server. When you enter the tmux command, a server is enabled.
Session Session. A server can contain multiple sessions.
Window Window. A session can contain multiple windows.
Pane Panel. A window can contain multiple panels.
Operation

Similar to various tiled Window managers, tmux uses a keyboard for operations. Common Shortcut Keys include:

CTRL + B Activate the console. The following buttons take effect:
System Operation ? List all shortcut keys; press Q to return
D Disconnects from the current session. In this way, you can return to the Shell Interface temporarily and enter tmux attach to re-enter the previous session.
D Select the session to be detached.
CTRL + z Suspend current session
R Force re-draw sessions not detached
S Select and switch sessions.
: Enter the command line mode. You can enter the supported commands, for example, kill-server can shut down the server.
[ Enter the replication mode. The operation is the same as that of VI/Emacs. Press Q/ESC to exit.
~ Lists the prompt information cache, which contains various prompt information returned by tmux.
Window operations C Create a new window
& Close current window
Number key Switch to the specified window
P Switch to the previous window
N Switch to the next window
L Switch between the front and back windows
W Switch window through window list
, Rename the current window to facilitate identification
. Modify the number of the current window; equivalent to reordering the window
F Search for specified text in all windows
Panel operations " Divide the current Panel equally into the upper and lower blocks
% Divide the current Panel into the left and right sides
X Close current Panel
! Place the current Panel in a new window, that is, create a new window that contains only the current Panel
CTRL + direction key Move the edge to adjust the current Panel size in units of 1 cell
Alt + direction key Move the edge in 5 cells to adjust the current Panel size
Space Cyclic switching in the preset panel layout, including even-horizontal, even-vertical, main-horizontal, main-vertical, and tiled
Q Display Panel number
O Select the next panel in the current window
Direction key Move the cursor to select a panel
{ Forward swap current Panel
} Swap the current Panel backward
Alt + O Rotate the panel of the current window counterclockwise
CTRL + O Rotate the panel of the current window clockwise
Configuration

the system-level configuration file of tmux is/etc/tmux. conf, and the user-level configuration file is ~ /. Tmux. conf. The configuration file is actually a command set of tmux, that is, each line of configuration can take effect after entering the command line mode.
below is ~ /. Example of tmux. conf, which includes some common configurations:

# In command line mode, you can enter show-options-g to query the initial sequence number of the Set-Option-G base-Index 1 # window. The default value is 0, set this parameter to 1set-option-G display-time 5000 # duration of the prompt message. Set enough time to avoid missing the prompt, unit: millisecond set-Option-G repeat-Time 1000 # duration after the console is activated; set the appropriate time to avoid activating the console before each operation, unit: millisecond set-Option-G Status-keys VI # default keyboard layout when operating the status bar; it can be set to VI or emacsset-Option-G Status-Right "# (date + % H: % m'')" # Content on the right of the status bar; set-Option-G Status-right-length 10 # Content Length on the right of the status bar, which is displayed; we recommend that you leave more space to the left of the status bar (used to list the current window) set-Option-G status-utf8 on UTF-8 support for enabling the status bar # This setting can be entered in command line mode to show-window-options-G query set-window-Option-G mode-keys VI # default keyboard layout in copy mode; can be set to VI or emacsset-window-Option-G utf8 on # enable window UTF-8 support # change the keyboard shortcut for the active console from Ctrl + B to Ctrl + ASET-Option-G prefix c-aunbind-key C-bbind-key C-a send-Prefix # Add a custom shortcut key bind-key Z kill-session # end the current session by Z; it is equivalent to entering the command line mode and then entering kill-sessionbind-key H select-layout even-horizontal # Switch the current Panel layout to even-horizontal by H; it is equivalent to entering select-layout even-horizontalbind-key v select-layout even-vertical after entering command line mode # Switch the current Panel layout to even-vertical by V; it is equivalent to entering select-layout even-vertical in command line mode.
More

The tmux manual is very detailed. Please enter man tmux and read it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.