tmux is a terminal multiplexer.
screen
users.New to tmux? The Tao of tmux is now available on Leanpub and Amazon Kindle. Read and browse the book for on the web.
Want more tmux? Check out the libtmux python library for controlling tmux, and load your code projects via YAML/JSON with tmuxp.
Download:
git clone --recursive https://github.com/tony/tmux-config.git ~/.tmux
Copy tmux config to home:
ln -s ~/.tmux/.tmux.conf ~/.tmux.conf
Go to config dir:
cd ~/.tmux
Works on Linux and OS X.
Prep ourself to download submodule (if you forgot --recursive
when cloning):
git submodule init
Download submodule:
git submodule update
Change dir to tmux-mem-cpu-load:
cd ~/.tmux/vendor/tmux-mem-cpu-load
Make ___build directory and cd
into it:
mkdir build; cd build
General make file:
cmake ..
Compile binary:
make
Install our binary to /usr/local/bin/tmux-mem-cpu-load
:
sudo make install
(No need to do sudo
if on OS X / macOS)
Go home:
cd ~
Launch tmux:
tmux
And press Control + a
then d
to go back to the terminal.
Update config:
tmux source-file ~/.tmux.conf
(Cross platform, tested with python 2.7+)
Update March 19, 2014. Works with psutil 2.0 now.
Install psutil
:
sudo pip install psutil
Copy ~/.tmux/vendor/basic-cpu-and-memory.tmux
to bin:
sudo cp ~/.tmux/vendor/basic-cpu-and-memory.tmux /usr/local/bin/tmux-mem-cpu-load
make executable:
sudo chmod +x /usr/local/bin/tmux-mem-cpu-load
You can add suport for powerline by adding these
to your ~/.tmux.conf
. Be sure to grab and install powerline-fonts
for your system.
See Powerline on ReadTheDocs.org for more info.
# pip install --user git+git://github.com/powerline/powerline
if-shell 'test -f ~/.local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf' 'source-file ~/.local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf'
# [sudo] pip install git+git://github.com/powerline/powerline
if-shell 'test -f /usr/local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf' 'source-file /usr/local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf'
# [sudo] pip install git+git://github.com/powerline/powerline
if-shell 'test -f /usr/local/lib/python2.7/dist-packages/powerline/bindings/tmux/powerline.conf' 'source-file /usr/local/lib/python2.7/dist-packages/powerline/bindings/tmux/powerline.conf'
# python 3.3 ?
if-shell 'test -f /usr/local/lib/python3.3/dist-packages/powerline/bindings/tmux/powerline.conf' 'source-file /usr/local/lib/python3.3/dist-packages/powerline/bindings/tmux/powerline.conf'
# python 3.4 ?
# if-shell 'test -f /usr/local/lib/python3.4/dist-packages/powerline/bindings/tmux/powerline.conf' 'source-file /usr/local/lib/python3.4/dist-packages/powerline/bindings/tmux/powerline.conf'
# python 3.5 ?
# if-shell 'test -f /usr/local/lib/python3.5/dist-packages/powerline/bindings/tmux/powerline.conf' 'source-file /usr/local/lib/python3.5/dist-packages/powerline/bindings/tmux/powerline.conf'
# python 3.6 ?
# if-shell 'test -f /usr/local/lib/python3.6/dist-packages/powerline/bindings/tmux/powerline.conf' 'source-file /usr/local/lib/python3.6/dist-packages/powerline/bindings/tmux/powerline.conf'
To start a session:
tmux
To reattach a previous session:
tmux attach
To reload config file
<Control + b>:
(which could Ctrl-B or Ctrl-A if you overidden it) then source-file ~/.tmux.conf
Our prefix/leader key is Control + a
now (just like the screen
multiplexer). This sequence must be typed before any tmux shortcut.
Control + a
before any commandControl + a
then ?
to bring up list of keyboard shortcutsControl + a
then "
to split windowControl + a
then <Space>
to change pane arrangementControl + a
then o
to rotate panesControl + a
then h
, j
, k
, l
to move left, down, up, right. Respectively. (vim hjkl)Control + a
then ;
to go to last panelBeyond your first window:
Control + a
then c
to create a new windowControl + a
then n
to next windowControl + a
then p
to previous windowControl + a
then [0-9]
move to window numberControl + a
then &
to kill windowCustom:
Control + a
then m
to switch to main-horizontal
layout with the main window at 2/3 height..Control + a
then M
to switch to main-vertical
layout with the main window at half width.此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。