I have long wanted a good terminal multiplexer to improve my workflow on a terminal; I tried Terminator before, but I did not like it very
much. I heard of Screen, but never tried it. After searching around, I decided to give Tmux a try. It does takes some time to learn
and has some compatibility issues with Vim; but that can be circumvented by configuring tmux properly, thanks to tmux’s highly configurable
The first problem I encounterd when started using tmux is Vim no longer recognizes modifier keys - SHIFT, CTRL and ALT, etc. The problem is
with an environmental variable both tmux and vim rely on: $TERM.
Thankfully, I found a thread here, which also explains
a valid solution for my use case. If you need a more detailed explanation, go check this blog post.
So, problem solved. But then I had a hard time configuring tmux to be vim-user friendly. Time to study something again.
First I found this nice tutorial for a tmux beginner. From this tutorial,
you can grasp clear pictures of the default key mappings in tmux, which is a corner-stone for configuring it. In the second part of this tutorial,
it shows some configuration examples, however not exactly fitting my taste.
Then, I found this gist post, which became my bootstrapping .tmux.conf file. I also learned some more
configuration tips from this post as well, which is more comprehensive.
Of course, after all these efforts configuring tmux, I have already learned “man tmux” and “prefix ?” are really good friends.
My current .tmux.conf file:
Want to know more about Vi mode in tmux? Check this post.