Skip to content

Instantly share code, notes, and snippets.

@MohamedAlaa
Last active April 9, 2026 03:05
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!

@sazerfenor
Copy link
Copy Markdown

This tmux cheatsheet is a lifesaver! I always forget the syntax for killing specific sessions. Since I'm focused on terminal productivity, I've also been using openclaw to manage my PC via Discord lately. It’s a great way to run commands even when I’m away from my desk!

@huhuhaheiovo
Copy link
Copy Markdown

huhuhaheiovo commented Feb 1, 2026

@worminone
Copy link
Copy Markdown

I might just start using tmux so I can master these shortcuts and finally impress my friends. Proximity chat in Fortnite sounds like a blast for team strategies! Speaking of gaming help, I recently used a pixel flow level to beat a tough puzzle level—it made things so much easier with clear tips.

@lazysoftwaredeveloper
Copy link
Copy Markdown

Great reference! The split window shortcuts (% and ") are essential for my workflow.

I usually keep my editor (Vim) in the left pane and a browser/reference in the right pane when working on configs.

For example, when I'm tweaking crafting tables, I keep my Hytale Item Database open in the side pane to quickly look up Item IDs and recipe JSONs without Alt-Tabbing.

In case anyone else is modding Hytale and needs the item data: Hytale Items Database

Thanks for the cheatsheet!

@VHero
Copy link
Copy Markdown

VHero commented Feb 5, 2026

Honestly, I might just start using tmux so I can finally master those shortcuts and impress my friends—who am I kidding? I'll just let them have the fun! Meanwhile, here's a cool Twitter IQ Checker for a different kind of fun. Just drop a handle and see if they’re a galaxy-brain philosopher or just a bot running on a loop.Twitter IQ Checker

@kaviparmar87-coder
Copy link
Copy Markdown

@zhaobingkun
Copy link
Copy Markdown

I might just start using tmux so I can master these shortcuts and finally impress my friends. Proximity chat in Fortnite sounds like a blast for team strategies! Speaking of gaming help, I recently used a pixel flow level to beat a tough puzzle level—it made things so much easier with clear tips.

@Microhx
Copy link
Copy Markdown

Microhx commented Mar 4, 2026

Great list for electric skateboards! It's awesome to see options for every budget. By the way, I was just playing a puzzle game called sand loop and got stuck on level 50. Your guide sounds super helpful for that too!

@MdvGame
Copy link
Copy Markdown

MdvGame commented Mar 4, 2026

https://lilylovebraids.pro/ The ultimate Lily Lovebraids fan hub: deep lore, walkthrough guides, fanart gallery, and Experiment 1468 merch from Poppy Playtime Chapter 5.

@annwo2025-a11y
Copy link
Copy Markdown

https://midicrossword.org/ A new tool for fun

@rordevelopernik
Copy link
Copy Markdown

Excellent tmux shortcuts and cheatsheet. Resources like this are valuable for developers at Carmatec looking to boost terminal efficiency.

@zhaobingkun
Copy link
Copy Markdown

🎮 Stuck on Pixel Flow levels?
Find step-by-step video solutions for tons of levels. Fast search, easy wins, smooth progress!
👉 http://pixelflowlevel.app

🧩 Love logic puzzles?
Get clear video walkthroughs for Clues by Sam levels and solve tricky clues without frustration.
👉 http://cluesbysam.net

✨ Playing Dreamy Room?
Watch full level walkthroughs, explore every room, and finish levels stress-free. Cozy vibes included!
👉 http://dreamyroomlevel.org

@zhaobingkun
Copy link
Copy Markdown

Stuck on Pixel Flow levels?
Find step-by-step video solutions for tons of levels. Fast search, easy wins, smooth progress!
 http://pixelflowlevel.app

Love logic puzzles?
Get clear video walkthroughs for Clues by Sam levels and solve tricky clues without frustration.
https://cluesbysam.net/game.html

Playing Dreamy Room?
Watch full level walkthroughs, explore every room, and finish levels stress-free. Cozy vibes included!
 http://dreamyroomlevel.org

@lazysoftwaredeveloper
Copy link
Copy Markdown

Thanks for sharing these shortcuts! I've bookmarked this. I usually use Meditation Timer Online to time my deep work sessions, and these tmux tips will make me even faster. Much appreciated!

@xhw0715
Copy link
Copy Markdown

xhw0715 commented Mar 17, 2026

Thank you. coreball

@jkuiox
Copy link
Copy Markdown

jkuiox commented Mar 18, 2026

@hill2hill
Copy link
Copy Markdown

Thanks for sharing these tmux shortcuts! They're super helpful for managing sessions. Speaking of managing things, I've been using similar tips for games like slay the spire 2 to keep track of strategies and progress. Great post!

@zhaobingkun
Copy link
Copy Markdown

Explore a vast anime-inspired open world, fight alongside legendary heroes, and rewrite destiny in The Seven Deadly Sins: Origin.
https://7sinsorigin.com/

Jump into fast-paced 3D FPS battles anytime, anywhere—no downloads needed. Compete with players worldwide and prove your skills in Veck.
 https://www.veck.app/

@sebastianluca
Copy link
Copy Markdown

Many people wonder soy fea o guapa, but confidence is what truly matters.

@sebastianluca
Copy link
Copy Markdown

Using a snowday meter is such a fun way to predict whether you’ll get a day off—it definitely adds excitement during the winter season! ❄️

@sebastianluca
Copy link
Copy Markdown

I always look out for fc mobile codes—they’re a great way to unlock rewards and boost your progress in the game!

@fongfiafia
Copy link
Copy Markdown

Its like you read my mind You appear to know a lot about this like you wrote the book in it scritchy scratchy wiki

https://www.pokepath.site
https://www.freakcircus.site
https://www.newtools.site
https://www.cakemania.org

@afflong
Copy link
Copy Markdown

afflong commented Mar 29, 2026

Great cheatsheet for tmux shortcuts! It's super helpful for managing sessions efficiently. Speaking of efficiency, when I need a break from coding, I like to relax by making music online. For example, you can play web harmonium to unwind with some free harmonium tunes—it's a fun virtual instrument!

@moshinrajpoot741-a11y
Copy link
Copy Markdown

This is quite useful! Sharing code snippets like this really helps developers save time and learn new approaches. Appreciate the contribution. I also like exploring modern trends like casual essentials wear

@sazerfenor
Copy link
Copy Markdown

This tmux cheatsheet is incredibly useful for managing terminal workflows efficiently. Just as I use organized systems for my claude buddy , having a quick reference for tmux commands saves so much time during development. Thanks for putting this together!

@zhaobingkun
Copy link
Copy Markdown

Jump into fast-paced 3D FPS battles anytime, anywhere—no downloads needed. Compete with players worldwide and prove your skills in Veck.
 https://veck.app/

@hugh2nd
Copy link
Copy Markdown

hugh2nd commented Apr 7, 2026

tmux shortcuts are a game changer for productivity, especially when you master the prefix combos. Speaking of mastering skills, if you're looking to level up your appearance, looksmaxxing insights could help you analyze your features and boost your confidence with personalized tips.

@codeyeclaw
Copy link
Copy Markdown

Super handige cheat sheet! Vooral het synchroniseren van panes en de copy mode tips zijn goud waard. Ik heb hierdoor mijn workflow aanzienlijk kunnen verbeteren. Wel jammer dat de afbeeldingen soms wat korrelig zijn, maar gelukkig bestaan er tools zoals een image quality reducer om dat op te lossen.

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