Skip to content

brianwoo/tmux-notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Tmux Notes

To Start

tmux

List all the sessions

tmux list-sessions
tmux ls

Detach the current session

Ctrl + b d

Attach to an existing session

tmux attach -t [session-id]
tmux a -t [session-id]

Pane management

  • a pane is a terminal section within a window

Horizontal Split

Ctrl + b "

Vertical Split

Ctrl + b %

Move to a different pane

Ctrl + b arrow key

Resize a pane

:resize-pane -L 20 # Resizes the current pane Left by 20 cells
:resize-pane -R 20 # Resizes the current pane Right by 20 cells
:resize-pane -D 20 # Resizes the current pane Down by 20 cells
:resize-pane -U 20 # Resizes the current pane Upward by 20 cells

or 
:set mouse on # do resize with a mouse
:set mouse off

Window management

  • a session can have multiple windows
  • a window can have mutiple panes

To create a Window

# within Tmux, type:
tmux new-window

or

Ctrl + b c

To switch between windows

Previous Window

Ctrl + b p

Next Window

Ctrl + b n

Kill a Window

Ctrl + b &

Rename a Window

Ctrl + b ,

Session Management

Rename a session

tmux rename-session [new-name]

or

Ctrl + b $

Switch to another session

Ctrl + b s

Awesome preset configurations (~/.tmux.conf)

# Prefix + r to load conf file
bind r source ~/.tmux.conf \; display "~/.tmux.conf loaded!"

# Prefix + k to toggle mouse mode on/off
bind-key k set-option -g mouse \; display-message 'Mouse #{?mouse,on,off}'

# Use Alt-arrow keys to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D

# Prefix + h / v to set window split
bind-key h split-window -h
bind-key v split-window -v

# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window

# Status Bar
set -g status-bg black
set -g status-fg colour35

About

Notes for Tmux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published