Published on

Learning and configuring tmux

Authors
  • avatar
    Name
    Chris Postma
    Twitter

I'm working to transition to VIM for my daily development work and tmux is a natural partner for a terminal based editor.

I recently followed a video by Josean Martinez where he describes his tmux setup from dotfiles all the way to keyboard shortcuts and have decided to use this as my starting point. You can view my dotfiles on GitHub here.

If attempting to use the below bindings, be sure to follow the linked tutorial above, as some bindings require plugins and others require bindings specified in tmux.conf.

Keyboard bindings

CommandDescription
ctrl+b also written as C-bprefix or leader command
tmux new -s <session_name>create new session with name
tmux detachexit session
tmux lslist all sessions
tmux attach -t <session_nameattach to session with name
C-b rcustom binding to source tmux.conf
C-b Iinstall plugins
C-b sview all sessions (interactive), use j and k to move between options
C-b |split window vertically
C-b -split window horizontally
C-b hresize pane left
C-b jresize pane down
C-b kresize pane up
C-b lresize pane right
C-b mmaximize pane
C-b nreturn pane to original size
C-hmove left one pane
C-jmove down one pane
C-kmove up one pane
C-lmove right one pane
C-b ccreate new tmux window
C-b <window_number>navigate to window by window number
C-b ,rename a window
C-b nnext window
C-b pprevious window
C-b wview all windows
C-dclose current pane
C-b &close current window
C-b xkill pane
CommandDescription
C-b [enter copy mode in tmux
h,j,k,lmovement (copy mode)
v <motion>copy text from terminal
Jscroll down
Kscroll up
C-uscroll up half page
C-dscroll down half page
C-fscroll up full page
C-bscroll down full page