NOTE: This repo was forked from tony/tmux-config and I made adaptation
- Tmux version should be higher than 2.5
<prefix>
changed to Ctrl + a (because vim use Ctrl + b)- Use tpm to manage tmux plug-in, already integrated:
- tmux-resurrect:
Restore
tmux
environment after system restart - tmux-continuum:
tmux
environment will be saved at the interval of 15 minutes. All the saving happens in the background without the impact to your workflow - tmux-mem-cpu-load:
A simple, lightweight program provided for system monitoring in the status line of
tmux
- tmux-resurrect:
Restore
Download:
git clone https://github.com/sharefantasy/tmux-config ~/.my_config/tmux
Download tpm:
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
Link tmux config to home:
ln -s ~/.my_config/tmux/tmux.conf ~/.tmux.conf
- type
tmux
in terminal - Press
<prefix>
+ I (capital I, as in Install) to fetch the plugin.
You're good to go! The plugin was cloned to ~/.tmux/plugins/
dir and sourced.
- pass color option to xterm, set tmux in
alias
tmux='TERM=xterm-256color /usr/local/bin'
- list all session
tmux ls
- create a new session
tmux new -s <session_name>
- attach to a session
tmux attch -t <session_name>
- kill a session
tmux kill-session -t <session_name>
- kill all session
tmux ls | grep : | cut -d. -f1 | awk '{print substr($1, 0, length($1)-1)}' | xargs kill
Our prefix/leader key is Ctrl + a now (just like the screen multiplexer). This sequence must be typed before any tmux shortcut. Some keymaps are customized, use <prefix>
+ ? to bring up list of keyboard shortcuts
keymap | desc |
---|---|
<prefix> + : + type new + enter |
new session |
<prefix> + s |
list sessions |
<prefix> + $ |
name session |
<prefix> + d |
de-attach from session |
keymap | desc |
---|---|
<prefix> + w |
list window |
<prefix> + c |
create a new window |
<prefix> + , |
rename current window |
<prefix> + n |
next window |
<prefix> + p |
previous window |
<prefix> + f |
find window |
<prefix> + 0 ~ 9 |
move to window number 0 ~ 9 |
<prefix> + & |
kill window |
keymap | desc |
---|---|
<prefix> + - |
split current window horizontally |
<prefix> + | |
split current window vertically |
<prefix> + q |
show panel number |
<prefix> + x |
kill a panel |
<prefix> + Space> |
to change pane arrangement |
<prefix> + o |
to rotate panes |
<prefix> + h/j/k/l |
to move left/down/up/right. Respectively. (vim hjkl) |
<prefix> + ; |
to go to last panel |
- enter copy mode by
<prefix>
+ [ or scroll the mouse - move around text via h/j/k/l
- press v to start select word
- h/j/k/l or other
vi
key-bind to select, like e - y to yank
- exit copy mode by press q
<prefix>
+ P to paste (capital P)
- LICENSE: MIT