As I wrote in previous post I switched from GNU screen to tmux. I use it for a few moths and have to said that I’m really impressed by simplicity, performance and community support in this project. In this post I want to discuss my configuration and useful additions for it like tmuxinator, session logging, colors or status bar configuration.
Basics
Debian contain tmux
package but for stable and testing release it is pretty
old version. Personally I use unstable
version where tmux
was delivered in
1.7~svn2819-1
version.
|
|
To start session simply type tmux
. Tmux uses C-b
/ Ctrl-b
as a prefix for
commands. If you switch from GNU screen then at the beginning you can experience
some annoying situations but after few days everything should back to normal.
Most used keybiddings:
C-b c
- create new windowC-b ,
- rename current windowC-b n
- next windowC-b p
- previous windowC-b l
- last windowC-b d
- disconnectC-b k
- kill current windowC-b K
- kill tmux serverC-b [
- enter copy modeC-b ]
- paste last copied bufferC-b :
- tmux command lineC-b w
- windows listC-b ?
- help
Full list can be found here.
Configuration
Tmux keeps its configuration in $HOME/.tmux.conf
. My configuration mixes some
tmux examples with code that I found in the net. This file can be found on my
github repository here. First section contain some general configuration:
|
|
After that I have implemented solarized colors (dark theme):
|
|
To make solarized colors work on my setup was quite challenging, because there are many things to set (vim, terminal, putty etc.). If you need any advice I can write something about this. Right now it is beyond the scope of this post. At the end of my tmux configuration I’ve some fancy status bar:
|
|
I think that mostly this is self explanatory. This how it look in work:
tmuxinator
I spend some time to realize what is the best way of managing windows and panes
in tmux. Especially I was interested in setting some windows at tmux startup.
Finally I found tmuxinator small but useful project delivered through gem
system. Follow tmuxinator page to set it up correctly. If you want to see my
primitive configuration it is also available on my github in
werkspace project.
Window logging
Last hint I found on this blog. How to log your work in console for example
to write a blog post :) ? There is a universal method for piping all console
output to our program of choice. For example run command like this (command mode
available under C-b :
):
|
|
This will give you file with logged session output (all curses windows, editor
windows and so on). Curses output can be unreadable because of control escape
sequences. Use cat
it will interpret escape sequences in terminal. As always I
hope hints were useful. Please share this content if think its valuable. Comment
if you think id needs improvements. Thank you for reading. P.S. I should
probably create a footer with last paragraph :)
