Skip to content

Instantly share code, notes, and snippets.

@fernandes
Last active August 29, 2015 14:02
Show Gist options
  • Save fernandes/4b15ea04b7c57faac6c3 to your computer and use it in GitHub Desktop.
Save fernandes/4b15ea04b7c57faac6c3 to your computer and use it in GitHub Desktop.
my tmux cheatsheet
# Cheat Sheet
## TMUX
starts new session tmux new -s <name>
attach deatached session tmux (a)ttach -t <name>
list sessions tmux ls
### Windows
new window ^a c
list windows ^a w
find window ^a f
rename-window to newname ^a , <newname>
rename-window to newname ^a :rename-window <newname>
kill window ^a &
swap current window right :swap-window -t +1
swap current window left :swap-window -t -1
swap current window to top :swap-window -t 0
swap window 3 with 1 :swap-window -s 3 -t 1
move current window right :move-window -t +1
move current window left :move-window -t -1
move current window to top :move-window -t 0
move window 3 with 1 :move-window -s 3 -t 1
### Copy & Paste
enter copy mode ^a [
visual selection v
copy selected text y
paste text ^a ]
copy to mac clipboard ^a ^c
copy from mac clipboard ^a ^v
### Panes
split pane horizontally ^a "
split pane vertically ^a %
splitswitch to another pane ^a o
show numeric values of panes ^a q
then press the number to go ^a q <number>
close panes except the current ^a !
swap location of panes ^a ^o
show time ^a t
kill pane ^a x
zoom pane (zoom to full screen) ^a z
resizes pane down resize-pane
resizes pane upward resize-pane -U
resizes pane left resize-pane -L
resizes pane right resize-pane -R
resizes pane down by 20 cells resize-pane 20
resizes pane upward by 20 cells resize-pane -U 20
resizes pane left by 20 cells resize-pane -L 20
resizes pane right by 20 cells resize-pane -R 20
resizes pane id 2 down 20 cells resize-pane -t 2 20
resizes pane id 2 left 20 cells resize-pane -t -L 20
**protip**
To resize in different steps, you can create maps that will adjust the
window size differently. For example to increase the window size by a
factor of 1.5 and decrease the window size by 0.67, you can map this:
nnoremap <silent> <Leader>+ :exe "resize " . (winheight(0) * 3/2)<CR>
nnoremap <silent> <Leader>- :exe "resize " . (winheight(0) * 2/3)<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment