Skip to content

Instantly share code, notes, and snippets.

@wikimatze
Created April 22, 2021 10:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wikimatze/aa6a2c78ffedc8ee4bf0803c38a73555 to your computer and use it in GitHub Desktop.
Save wikimatze/aa6a2c78ffedc8ee4bf0803c38a73555 to your computer and use it in GitHub Desktop.
Basic introduction into tmux

%title: tmux - terminal multiplexer for Unix OS %author: @wikimatze %date: 2021-04-22

-> tmux <-

-> Have multiple terminal sessions used in parallel in a single window <-


Like a window manager for your terminal (check [i3](http://i3wm.org) or [awesome](https://awesomewm.org))
_Features:_
- Emacs or vi like command mode/mappings for managing tmux
- horizontal and vertical window split support
- remote sessions can be detached (run in background)
- free choice of key bindings
- hackable via scripts
- adjustable with **tmux.conf**

-> # Windows <-

> all commands in tmux starts with Prefix, which is Ctrl-b. > Prefix : will get you in command-mode.


- `Prefix c` ... create a new window
- `Prefix :split-window -h` ... horizontal split
- `Prefix :split-window -s` ... vertical split
- `Prefix x` ... kill pane/window

-> # Make your life easier <-

> Time to create your ~/.tmux.conf

\ # Prefix remap to \ unbind C-b # the old Prefix mapping is gone, we can use it for a new command \ bind C-a send-prefix # Prefix a twice will send the command throughout tmux to other programs \ set -g prefix C-a # remap of Prefix (-g says it's global to all sessions)


as well as:

\ # 'Prefix v', 'Prefix s' ... horizontal/vertical split \ bind v split-window -h \ bind s split-window -v


now refresh tmux: Prefix :source-file $HOME/.tmux.conf


-> # Moving around <-


- `Prefix n|p` ... moving to the next/previous window
- `Prefix o` ... cycle through panes

-> # Fancy things <-

  • Prefix d ... detach current session

-- `$ tmux attach-session -t 0` ... get back into session
- `Prefix z` ... will maximize/minimize the current pane (zoom)
- `Prefix :rename-session -t `
- `Prefix :choose-session`
- `Prefix ?` ... list all keybindings
- `Prefix :set -g mouse on` ... enable mouse support

-> # Showcase <-

  • Resize panes demo with vim bindings :)

- `Prefix f` ... search
- URL view plugins
- Send key demo

-> # More?! <-


- [book](https://pragprog.com/titles/bhtmux2/tmux-2/)
- [tpm](https://github.com/tmux-plugins/tpm) > plugins for a lot of things
- [check my configs](https://github.com/wikimatze/dotfiles/blob/master/tmux.conf)

Thanks for your time

        _,'|             _.-''``-...___..--';)
       /_ \'.      __..-' ,      ,--...--'''
      <\    .`--'''       `     /'
       `-';'               ;   ; ;
 __...--''     ___...--_..'  .;.'
(,__....----'''       (,..--''   Time to relax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment