Tmux is needed?
During your daily work, it’s quite common to open several windows to accomplish your tasks.
If you don’t use
Tmux alike screen manager, it will be totally a nightmare.
Following demonstrates a typical scene. You open a window to view the code project, and another one to build it. Apart from them, you can also open some other auxiliary windows, e.g,
htop window, to watch the real-time CPU performance.
What’s more, if you are a DevOps engineer who should ssh to remote machine to do some developments, you will find
Tmux useful. It offers you the mechanism to close the session temporarily without any concern, and reattach to it in an easy manner.
Tmux will manage the sessions until your next access.
There are definitely other alternatives to
screen, and you can choose anyone as you like.
In this post, we mainly describe our settings based on
sudo apt-get install tmux
Download the config repo to your home directory:
git clone --recursive email@example.com:sunbingfeng/tmux-config.git $HOME/.tmux
Set it as the default tmux configuration:
ln -s ~/.tmux/.tmux.conf ~/.tmux.conf
The default prefix/leader key is
Control+o, and you can change it to your preference.
tmuxto create a new tmux session
tmux ato attach to an existed session
- The prefix key must be typed before any commands
?to bring up list of key mappings
sto show list of windows available
fto search window through keywords
,to rename current window
&to kill current window
cto create new window
nto goto the next window
pto goto the previous window
Control+aswitch between current and last window
[0-9]to goto the numbered window
vto split horizontally
bto split vertically
;to switch between current and last pane
lto move left, down, up, right respectively as vim does
zto maximum/restore current pane
xto close current pane
xclip be default, so you should install it through:
sudo apt-get install xclip
[to enter copy mode
vto select blocks, or
Vto select multiple lines, and then
yto copy it to clipboard
- Goto where you want to paste, and press
ito enter edit mode. Press