Skip to content

Instantly share code, notes, and snippets.

@MohamedAlaa
Last active July 8, 2026 16:39
Show Gist options
  • Select an option

  • Save MohamedAlaa/2961058 to your computer and use it in GitHub Desktop.

Select an option

Save MohamedAlaa/2961058 to your computer and use it in GitHub Desktop.
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

attach:

tmux a  #  (or at, or attach)

attach to named:

tmux a -t myname

list sessions:

tmux ls

kill session:

tmux kill-session -t myname

Kill all the tmux sessions:

tmux ls | grep : | cut -d. -f1 | awk '{print substr($1, 0, length($1)-1)}' | xargs kill

In tmux, hit the prefix ctrl+b (my modified prefix is ctrl+a) and then:

List all shortcuts

to see all the shortcuts keys in tmux simply use the bind-key ? in my case that would be CTRL-B ?

Sessions

:new<CR>  new session
s  list sessions
$  name session

Windows (tabs)

c  create window
w  list windows
n  next window
p  previous window
f  find window
,  name window
&  kill window

Panes (splits)

%  vertical split
"  horizontal split

o  swap panes
q  show pane numbers
x  kill pane
+  break pane into window (e.g. to select text by mouse to copy)
-  restore pane from window
⍽  space - toggle between layouts
<prefix> q (Show pane numbers, when the numbers show up type the key to goto that pane)
<prefix> { (Move the current pane left)
<prefix> } (Move the current pane right)
<prefix> z toggle pane zoom

Sync Panes

You can do this by switching to the appropriate window, typing your Tmux prefix (commonly Ctrl-B or Ctrl-A) and then a colon to bring up a Tmux command line, and typing:

:setw synchronize-panes

You can optionally add on or off to specify which state you want; otherwise the option is simply toggled. This option is specific to one window, so it won’t change the way your other sessions or windows operate. When you’re done, toggle it off again by repeating the command. tip source

Resizing Panes

You can also resize panes if you don’t like the layout defaults. I personally rarely need to do this, though it’s handy to know how. Here is the basic syntax to resize panes:

PREFIX : resize-pane -D (Resizes the current pane down)
PREFIX : resize-pane -U (Resizes the current pane upward)
PREFIX : resize-pane -L (Resizes the current pane left)
PREFIX : resize-pane -R (Resizes the current pane right)
PREFIX : resize-pane -D 20 (Resizes the current pane down by 20 cells)
PREFIX : resize-pane -U 20 (Resizes the current pane upward by 20 cells)
PREFIX : resize-pane -L 20 (Resizes the current pane left by 20 cells)
PREFIX : resize-pane -R 20 (Resizes the current pane right by 20 cells)
PREFIX : resize-pane -t 2 -L 20 (Resizes the pane with the id of 2 left by 20 cells)

Copy mode:

Pressing PREFIX [ places us in Copy mode. We can then use our movement keys to move our cursor around the screen. By default, the arrow keys work. we set our configuration file to use Vim keys for moving between windows and resizing panes so we wouldn’t have to take our hands off the home row. tmux has a vi mode for working with the buffer as well. To enable it, add this line to .tmux.conf:

setw -g mode-keys vi

With this option set, we can use h, j, k, and l to move around our buffer.

To get out of Copy mode, we just press the ENTER key. Moving around one character at a time isn’t very efficient. Since we enabled vi mode, we can also use some other visible shortcuts to move around the buffer.

For example, we can use "w" to jump to the next word and "b" to jump back one word. And we can use "f", followed by any character, to jump to that character on the same line, and "F" to jump backwards on the line.

   Function                vi             emacs
   Back to indentation     ^              M-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 to end of line   D              C-k
   End of line             $              C-e
   Goto line               :              g
   Half page down          C-d            M-Down
   Half page up            C-u            M-Up
   Next page               C-f            Page down
   Next word               w              M-f
   Paste buffer            p              C-y
   Previous page           C-b            Page up
   Previous word           b              M-b
   Quit mode               q              Escape
   Scroll down             C-Down or J    C-Down
   Scroll up               C-Up or K      C-Up
   Search again            n              n
   Search backward         ?              C-r
   Search forward          /              C-s
   Start of line           0              C-a
   Start selection         Space          C-Space
   Transpose chars                        C-t

Misc

d  detach
t  big clock
?  list shortcuts
:  prompt

Configurations Options:

# Mouse support - set to on if you want to use the mouse
* setw -g mode-mouse off
* set -g mouse-select-pane off
* set -g mouse-resize-pane off
* set -g mouse-select-window off

# Set the default terminal mode to 256color mode
set -g default-terminal "screen-256color"

# enable activity alerts
setw -g monitor-activity on
set -g visual-activity on

# Center the window list
set -g status-justify centre

# Maximize and restore a pane
unbind Up bind Up new-window -d -n tmp \; swap-pane -s tmp.1 \; select-window -t tmp
unbind Down
bind Down last-window \; swap-pane -s tmp.1 \; kill-window -t tmp

Resources:

Notes:

Changelog:

Request an Update:

We Noticed that our Cheatsheet is growing and people are coloberating to add new tips and tricks, so please tweet to me what would you like to add and let's make it better!

@asmrcob-eng

Copy link
Copy Markdown

Discover how Construction Estimating Services Texas help contractors and builders achieve accurate cost planning, better budgeting, and successful project management. Learn why professional estimating solutions are essential for reducing risks, improving bidding accuracy, and controlling construction expenses.

@wyong32

wyong32 commented Jun 12, 2026 via email

Copy link
Copy Markdown

@aryastarc

Copy link
Copy Markdown

Construction Estimating Services NYC provide accurate cost estimates and material takeoffs for residential, commercial, and industrial projects. Our experts help contractors improve bid accuracy, control budgets, reduce risks, and maximize profitability throughout New York City construction projects.

@eixom

eixom commented Jun 15, 2026

Copy link
Copy Markdown

Still one of the most practical tmux references on GitHub. I end up coming back to this gist every few months. These days my workflow is mostly tmux + Neovim + kepo.ai, and this cheat sheet remains a great quick reference. Thanks for sharing.

@Enivel

Enivel commented Jun 15, 2026 via email

Copy link
Copy Markdown

@chaoditang

Copy link
Copy Markdown

Great read! For anyone who enjoys number puzzles but wants something a bit less serious, the Meowdoku Game Guide breaks down the cat-themed logic in a surprisingly clear way. The walkthroughs make tricky levels feel manageable, and the app links are a nice bonus. Definitely worth a bookmark if you are tired of standard sudoku grids.

@chaoditang

Copy link
Copy Markdown

Great read! For anyone who enjoys number puzzles but wants something a bit less serious, the Meowdoku Game Guidebreaks down the cat-themed logic in a surprisingly clear way. The walkthroughs make tricky levels feel manageable, and the app links are a nice bonus. Definitely worth a bookmark if you are tired of standard sudoku grids.

@Construction09

Copy link
Copy Markdown

[Construction Estimating Services NYC] offers reliable cost estimates and detailed material takeoffs for residential, commercial, and industrial construction projects. Our experienced estimators help contractors prepare more accurate bids, stay within budget, minimize project risks, and increase profitability. We provide the insights and support needed to keep construction projects across New York City running smoothly and efficiently.

@dead-plate-game

Copy link
Copy Markdown

Dead Plate is one of those short horror games that hides its teeth behind good manners. Dead Plate opens in a tidy 1960s French bistro, hands you an apron, and lets you assume the worst part of the night will be a rude customer.

Thank you, this is my repo: https://github.com/dead-plate-game

@JasonLee901

Copy link
Copy Markdown

The whole section on setting the vi mode with setw -g mode-keys vi is a major quality-of-life improvement for anyone spending serious time in tmux. I've been playing around with customizing keybindings for years, and getting that familiar Vim feel really makes navigating copy mode much faster. When you get into complex terminal workflows like managing multiple sessions, knowing where to find resources like traffic rider is helpful contextually!

@chenglemoon

Copy link
Copy Markdown

Useful resource! A few free tools I recommend alongside tmux:
Pixel Art Grid— image to pixel art grid converter with color palette
Square Face — square profile picture generator
Bold Text — bold & special text formatter for documentation

@fortnitespritechecklist

Copy link
Copy Markdown

The Fortnite Sprite Checklist and Fortnite Sprite Tracker in one — log every Sprite and variant, see what you're missing, and know exactly what to chase next.
Thank you, this is my repo: https://github.com/fortnitespritechecklist

@zhaobingkun

Copy link
Copy Markdown

A few months ago, most AI-generated images were easy to spot.
Now I'm not so sure.
I've been seeing images online that look completely real at first glance, and it made me wonder how often we're getting fooled without realizing it.
So I built a simple tool to analyze images and check whether they might be AI-generated.
https://imageaichecker.com/

@lemon12345

Copy link
Copy Markdown

This is incredibly useful, thanks @MohamedAlaa! I've had this bookmarked for years.
Sharing a couple of free tools I've been using lately that might interest fellow devs here:
Token Maker — quick VTT token generator for RPG sessions
Spiral Betty — turns photos into spiral string art patterns
Great complements to a tmux-powered workflow when you need a creative break. Cheers!

@lemon12345

Copy link
Copy Markdown

Great cheatsheet, still reference this regularly!
On a related note — if you're looking to refresh your GitHub or social media avatar for Pride Month or anytime, these free PFP makers are solid: Pride PFP and LGBTQ PFP. Both are instant, no-signup, and export high-res images. Easy way to add some color to your dev profile. 🌈

@zhaobingkun

Copy link
Copy Markdown

Wuwa tracker for current and past banners:
https://wuwabanners.net/

Includes pity and banner history.

@zhaobingkun

Copy link
Copy Markdown

Really helpful post! I’ve been using step-by-step video guides for tricky levels lately, and it makes a huge difference when you’re stuck. Found this one pretty useful:
https://pixelflowlevel.app

@zhaobingkun

Copy link
Copy Markdown

Nice breakdown, especially for players who get stuck on harder clues. I’ve been checking some walkthroughs for Clues by Sam levels here, might help others too:
https://cluesbysam.net

@zhaobingkun

Copy link
Copy Markdown

Nice breakdown, especially for players who get stuck on harder clues. I’ve been checking some walkthroughs for Clues by Sam levels here, might help others too:
The Seven Deadly Sins: Origin https://7sinsorigin.com/

@nabeel9beel-ops

Copy link
Copy Markdown

Great resource! Predicting school disruptions during severe winter weather is always tough for families. Using data-driven tools like a Snow Day Chance makes it much easier to guess if school will be cancelled tomorrow based on real-time storm tracking. Thanks for sharing this script!

@youyouguoke

Copy link
Copy Markdown

This cheatsheet is exactly the kind of reference I keep pinned to a tmux pane whenever I’m working on long-form guides. The breakdown into Sessions, Windows, and Panes is clear, and I especially appreciate the pane commands: % for vertical split and " for horizontal split, plus PREFIX z for zoom and PREFIX {/} to shuffle panes. These are my go-to shortcuts for comparing notes side by side. I also liked the reminder that PREFIX ? lists all key bindings, since I always forget the exact shortcuts.

One feature I keep coming back to is the synchronize-panes tip. Running :setw synchronize-panes across multiple panes has saved me so much time when I need to run identical commands on several SSH sessions. Have you found a clean way to persist that setting per window across tmux restarts, or do you prefer to keep it manual for safety?

I also switched my copy mode to vi with setw -g mode-keys vi, so using h, j, k, l to move around the buffer feels natural. The only thing I would add is that binding PREFIX + and PREFIX - for pane zoom/restoration can be handy if your terminal font sizes differ.

If you’re writing a lot of documentation, terminal multitasking is a game changer. I’ve been using a similar workflow to keep my browser, notes, and text editor open while building a fan project. Speaking of fan guides, if you’re into visual novel horror games, I’ve been collecting character profiles, endings, and hidden lore over at [url=freak-circus.com]The Freak Circus[/url]—it’s a great resource for anyone trying to map out the Freak Circus timeline and secrets. Thanks for putting this together!

@rordevelopernik

Copy link
Copy Markdown

Excellent tmux shortcuts and cheatsheet. Resources like this are valuable for developers like us who works at Carmatec Qatar looking to boost terminal efficiency. https://carmatec.qa/best-mobile-app-development-company-qatar/

@youyouguoke

Copy link
Copy Markdown

This is exactly the kind of cheat sheet I keep pinned to my second monitor. I’ve been using tmux for years, but I always forget a few commands until I suddenly need them. Your breakdown of the prefix shortcuts is clean—especially the sessions section: :new<CR>, s to list sessions, and $ to name a session. I used to rename sessions with the long command line until I realized the $ keybinding existed, which made me feel a bit silly.

The pane management section is what I come back to most. % for a vertical split and " for a horizontal split is intuitive, but I still mix them up sometimes. The tip on <prefix> z for zooming a pane is a lifesaver when reading dense logs or copying text. And speaking of copying, I’m glad you included copy mode. I recently switched to setw -g mode-keys vi in my .tmux.conf, and using h, j, k, l inside the buffer feels so much better than reaching for the arrow keys. One thing I’d add: once you’re in vi mode, you can hit v to start a selection and y to yank it, which makes the whole workflow feel seamless.

A quick question: you mention setw synchronize-panes is useful for broadcasting commands across multiple panes. Do you use it for deploying to multiple servers at once, or more for local parallel tasks? I’ve always been nervous about accidentally running destructive commands across all panes, so I’ve only used it sparingly.

On a related note, while I’m documenting The Freak Circus characters, endings, and hidden lore over at https://freak-circus.com, I often keep a tmux session split between my notes editor, a browser running the game, and a terminal for data extraction. It’s a weird combo, but tmux makes it manageable.

@gamevaultapkdownload

Copy link
Copy Markdown

In today’s digital era, gamers are always looking for a platform that offers smooth performance, easy access, and a wide variety of games without any complications. Gamevault Download provides a simple solution by allowing users to install and enjoy a complete gaming experience with ease, where they can explore multiple games in one place. With its user-friendly interface, fast loading speed, and regular updates, it becomes a reliable choice that keeps players engaged and always ready to try something new.

@letmemeng-crypto

Copy link
Copy Markdown

Her Trees Puzzle Dream invites you into a quiet, eerie world where every scene hides a small mystery. Explore hand-drawn spaces, combine objects, and uncover clever puzzle logic at your own pace. It is a calm yet haunting adventure for players who enjoy observation, atmosphere, and thoughtful discovery.

@Rapen-Z

Rapen-Z commented Jul 5, 2026

Copy link
Copy Markdown

This tmux cheatsheet is super handy for quickly referencing sessions, windows, and panes. If you're into developer tools and shortcuts, you might also find online tools, free online tools, JSON formatter, Base64 encoder, password generator, URL encoder, UUID generator, developer tools, online dev tools, text tools useful for your workflow.

@nabeel9beel-ops

Copy link
Copy Markdown

Goojara APK operates as a lightweight indexing directory for Android devices, aggregating streaming links to movies, television series, and animated content from various external third-party servers. The platform functions without requiring explicit user registration. It includes standard sorting filters based on genre, release year, and alphabetical order. Since the application is distributed as a manual APK file, users must configure installation permissions and verify package integrity using local security tools.

@Enivel

Enivel commented Jul 8, 2026 via email

Copy link
Copy Markdown

@Enivel

Enivel commented Jul 8, 2026 via email

Copy link
Copy Markdown

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