Skip to content

Instantly share code, notes, and snippets.

@nickkaczmarek
Forked from Alek-S/tmux_commands.md
Last active July 30, 2018 14:58
Show Gist options
  • Save nickkaczmarek/fb35de00ee80bfcc7a5c2e52f8640698 to your computer and use it in GitHub Desktop.
Save nickkaczmarek/fb35de00ee80bfcc7a5c2e52f8640698 to your computer and use it in GitHub Desktop.
tmux Commands

Start new named session:

tmux new -s [session name]

List sessions:

tmux ls

Attach to named session:

tmux a -t [name of session]

Kill named session:

tmux kill-session -t [name of session]

Move to another pane:

ctrl+a [arrow key]

Kill tmux server, along with all sessions:

tmux kill-server

Shortcut Reference

Now a Prefix options reference:

Basics

Command What it does
? get help

Session management

Command What it does
s list sessions
$ rename the current session
d detach from the current session

Windows

Command What it does
c create a new window
, rename the current window
w list windows
- split horizontally
| split vertically
n change to the next window
p change to the previous window
0 to 9 select windows 0 through 9

Panes

Command What it does
_ create a horizontal pane
| create a vertical pane
q show pane numbers
o toggle between panes
} swap with next pane
{ swap with previous pane
! break the pane out of the window
x kill the current pane
z maximize the current pane

Miscellaneous

Command What it does
t show the time in current pane
@nickkaczmarek
Copy link
Author

as per my .tmux.conf

@nickkaczmarek
Copy link
Author

Copy/Paste


  1. enter copy mode using Control+b [
  2. navigate to beginning of text, you want to select and hit Control+Space
  3. move around using arrow keys to select region
  4. when you reach end of region simply hit Alt+w to copy the region
  5. now Control+b ] will paste the selection

@nickkaczmarek
Copy link
Author

@nickkaczmarek
Copy link
Author

Copy text from tmux to system

tmux config: setw -g mode-mouse on

Press and hold SHIFT and select the text by mouse, then click left-button of mouse.

To paste text into tmux, press SHIFT and click right-button of mouse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment