8. Benefits
• Available anywhere
• Terminal independent
• Highly customisable
• Sessions are awesome (…we’ll still get to that)
• Integrates well with vim (or emacs, I guess)
13. Windows
• New window: <prefix> c
• Next window: <prefix> n
• Previous window: <prefix> p
• Go to window by number: <prefix> 0..9
• List windows: <prefix> w
• Rename window: <prefix> ,
16. Customising mappings
• You work with windows and panes all the time
• Default key mappings are clunky
• tmux makes it easy to change stuff
• Config file lives in ~/.tmux.conf
17. Starting point
• http://tiny.cc/licotmux
• Sane defaults (UTF-8, vi-keys, status line)
• Easier splits (C-h/j/k/l, M--, M-)
• Easier window navigation (M-j/k)
• Easier session navigation (M-8, M-9/0)
• Some other junk (but not too much)
18. Sessions
• Sessions can run headlessly
• Close your terminal (or tab), re-attach later:
tmux attach -t foo
• Quickly switch context
22. tmux-resurrect
+ Nothing to write
+ Quick & easy to use
+ Restores vim sessions
+ I prefer it, so you should too!
- Not as portable
- Can’t copy settings from context to context
23. tmux-resurrect installation
• Install TPM, the tmux plugin manager
https://github.com/tmux-plugins/tpm
• Install tmux-resurrect as a plugin
https://github.com/tmux-plugins/tmux-resurrect
• Just RTFMs.
24. tmux-resurrect usage
1. Do stuff
2. <prefix> <C-s> # save
3. … PC crashes …
4. Start tmux
5. <prefix> <C-r> # restore
6. Smile :-)
26. Splits & panes
• Install christoomey/vim-tmux-navigator
https://github.com/christoomey/vim-tmux-navigator
• Move between vim splits and tmux panes with C-
h/j/k/l.
27. Send command to pane
• Install benmills/vimux
https://github.com/benmills/vimux
• :VimuxRunCommand “foo”
• Check out the GitHub page for related plugins.
28. Run specs in pane
• Install thoughtbot/vim-rspec
https://github.com/thoughtbot/vim-rspec
• let g:rspec_command = '
call VimuxRunCommand(
"clear && bundle exec rspec {spec}")'
• :call RunNearestSpec()
31. Other stuff
tmux-continuum
Automates restoring tmux-resurrect sessions
https://github.com/tmux-plugins/tpm
tmux-cheatsheet
Great list of mappings. Also try <prefix> ?
https://gist.github.com/MohamedAlaa/2961058
Consider remapping prefix
What if you’re running tmux over ssh in tmux?
Slides
http://www.slideshare.net/jschembri/tmux-development-workflow