Contents
  1. 1. Configure Tmux and Vim
  2. 2. Tmux
  3. 3. Vim

I just had enough of creating numerous ssh connections to manipulate on a server. After searching on Internet, I found Tmux a kick-ass terminal multiplier. But Tmux has so many shortcuts just like Vim. I think it might be worth writing down some common shortcuts.

Configure Tmux and Vim

  • add set mouse=a in ~/.vimrc
  • add set-option -g mouse on in ~/.tmux.conf

Tmux

Action Shortcut
start a new session tmux new -s NAME
attach a session tmux attach -t NAME
list sessions tmux ls
detach from current session Ctrl+b -> d
create a window Ctrl+b -> c
go to window Ctrl+b -> NUMBER
go to next window Ctrl+b -> n
go to previous window Ctrl+b -> p
select a session Ctrl+b -> s
go to previous session Ctrl+b -> (
go to next session Ctrl+b -> )
go to previous window Ctrl+b -> p
split window/pane horizontally Ctrl+b -> “
split window/pane vertically Ctrl+b -> %
kill the current pane Ctrl+b -> x

Vim

Action Shortcut
split window horizontally :split
split window vertically :vsplit
resize a window :NUMwinc[-+<>]
edit a file :e FILENAME
scroll synchronously :set scrollbind
jump to the start of the line 0
jump to the first non-blank character of the line ^
jump to the end of the line $
move back one full screen Ctrl+b
move forward one full screen Ctrl+f
move back a half screen Ctrl+u
move forward a half screen Ctrl+d
show line number :set number
Contents
  1. 1. Configure Tmux and Vim
  2. 2. Tmux
  3. 3. Vim