Tmux
Set up tmux on linux
Basic
- Create a named session called “basic”
- Exit the session:
CheatSheet
-
Session:
Shortcut Description Usage Ctrl + b Prefix tmux new -s basic_session Create a new tmux session Prefix + d Detach from a tmux session Enter 1 session, do some work (like htop), detach from this session tmux ls List sessions tmux attach -t basic_session Attach the session to current terminal -
Windows:
Shortcut Description Ctrl + b Prefix tmux new -s windows -n shell Create a tmux session called “windows”, the initial window is called “shell” Prefix + c Create a window in a current ession, automatically brought into focus Prefix + , Rename a window name Prefix + n Move to next window Prefix + p Move to previous window Prefix + 0 (number) Move to the first window Prefix + w Display a visual menu of all windows Prefix + f Find window that contains a string of text -
Panes:
Command Description Ctr + b Prefix tmux new -s panes_demo Create a session to demo panes Prefix + % Split the window in half vertically Prefix + “ Split the window horizontally Prefix + h,j,k,l (o) Move around the panes, cycle through the panes
Command | Description |
---|---|
Prefix + [ | Into copy mode |
Prefix + ] / Prefix + P Ctr + V | Paste |
Enter | Get out of copy mode |
Ctrl - b | Move up 1 page |
Ctrl - f | Move down 1 page |
[Copy mode] ? | Search backward |
[Copy mode ?] n | jump to next occurrence |
[Copy mode ?] N | jump to the previous |
[Copy mode] / | Search downward |
[Copy mode /] n | jump to next occurrence |
[Copy mode /] N | jump to the previous |
Prefix + = | View all copy buffer and choose 1 |
Tmuxinator
export EDITOR=vim