A good[ish] website
Web development blog, loads of UI and JavaScript topics
A searchable tmux keyboard shortcut and command reference.
Command | Description |
---|---|
$ tmux , $ tmux new , $ tmux new-session , : new | Start a new session |
$ tmux new -s testSes , : new -s testSes | Start a new named session |
$ tmux kill-ses -t testSes , $ tmux kill-session -t testSes | Kill session testSes |
$ tmux kill-session -a | Kill all sessions but the current |
$ tmux kill-session -a -t testSes | Kill all sessions but testSes |
Ctrl+b $ | Rename the session |
Ctrl+b d | Detach from session |
: attach -d | Detach others clients on the session |
$ tmux -ls , $ tmux list-sessions , Ctrl+b s | Show all sessions |
$ tmux a , $ tmux at , $ tmux attach , $ tmux attach-session | Attach to last session |
$ tmux a -t testSes , $ tmux at -t testSes , $ tmux attach -t testSes , $ tmux attach-session -t testSes | Attach to a session called testSes |
Ctrl+b ( | Move to the previous session |
Ctrl+b ) | Move to the next session |
Command | Description |
---|---|
$ tmux new -s testSes -n testWin | Start a new session called testSes and window testWin |
Ctrl+b c | New window |
Ctrl+b , | Rename the current window |
Ctrl+b & | Close the current window |
Ctrl+b p | Go to the previous window |
Ctrl+b n | Go to the next window |
Ctrl+b 0 ... 9 | Switch/select window by number |
: swap-window -s 2 -t 1 | Reorder windows, swap window number 2 (source) and 1 (destination) |
: swap-window -t -1 | Move the current window to left by one |
Command | Description |
---|---|
Ctrl+b ; | Toggle last active pane |
Ctrl+b % | Split pane vertically |
Ctrl+b " | Split pane horizontally |
Ctrl+b { | Move the current pane left |
Ctrl+b } | Move the current pane right |
Ctrl+b ➡︎, Ctr➡l+b ⬅︎, Ctrl+b ⬆︎, Ctrl+b ⬇︎ | Switch to pane to the direction |
: setw synchronize-panes | Toggle synchronize-panes (sends a command to all panes) |
Ctrl+b Space | Toggle between pane layouts |
Ctrl+b o | Switch to next pane |
Ctrl+b q | Show pane numbers |
Ctrl+b b q 0 ... 9 | Switch/select pane by number |
Ctrl+b z | Toggle pane zoom |
Ctrl+b ! | Convert pane into a window |
Ctrl+b ⬆︎, Ctrl+b Ctrl+⬆︎, Ctrl+b+⬇︎, Ctrl+b Ctrl+⬇︎ | Resize current pane height (holding second key is optional) |
Ctrl+b ➡︎, Ctrl+b Ctrl+➡︎, Ctrl+b+⬅︎, Ctrl+b Ctrl+⬅︎ | Resize current pane width (holding second key is optional) |
Ctrl+b x | Close current pane |
Command | Description |
---|---|
: setw -g mode-keys vi | Use vi keys in buffer |
Ctrl+b [ | Enter the copy mode |
Ctrl+b PgUp | Enter copy mode and scroll one page up |
q | Quit copy mode |
g | Go to top line |
G | Go to bottom line |
⬆︎ | Scroll up |
⬇︎ | Scroll down |
h | Move cursor left |
j | Move cursor down |
k | Move cursor up |
l | Move cursor right |
w | Move cursor forward one word |
b | Move cursor backward one word |
/ | Search forward |
? | Search backwards |
n | Next keyword occurrence |
N | Previous keyword occurrence |
Space | Start selection |
Esc | Clear selection |
Enter | Copy selection |
Ctrl+b ] | Paste contents of buffer_0 |
: show-buffer | display buffer_0 contents |
: capture-pane | Copy entire visible contents of pane into a buffer |
: list-buffers | Show all buffers |
: choose-buffer | Show all buffers and paste selected |
: save-buffer buffer.txt | Save buffer contents to buffer.txt |
: delete-buffer -b 1 | Delete buffer_1 |
Command | Description |
---|---|
Ctrl+b : | Enter the command mode |
: set -g OPTION | Set OPTION for all sessions |
: setw -g OPTION | Set OPTION for all windows |
Command | Description |
---|---|
$ tmux info | Show every session, window, pane, and so on. |
Ctrl+b ? | Show shortcuts |
Tmux is a terminal multiplexer. For example you can open a tmux session and it will keep all the processes running even if you close the terminal, so you can later on attach back to the session and resume where you left off. This way you can leave long lasting tasks running, for examples an Irssi IRC client etc.
Besides that, tmux can serve as a window manager, you can split the terminal into panes (think of split view), or open new windows (think of tabs). See my post on how to install and use tmux for more detailed info.
You can quickly search this guide from Alfred if you setup a custom search. Click here to add it automatically. Or see instructions below how to add it manually.
https://clubmate.fi/tmux-cheat-sheet?s={query}
.Comments would go here, but the commenting system isn’t ready yet, sorry.