Ⅰ. 插件描述
:green_book: Example tmux configuration - screen + vim key-bindings, system stat, cpu load bar.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'tony/tmux-config-the-story-of-us'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'tony/tmux-config-the-story-of-us'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'tony/tmux-config-the-story-of-us'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/tony/tmux-config
Ⅳ. 文档说明
tmux is a terminal multiplexer.
- Tested with tmux 1.5+.
- Support for tmux-mem-cpu-load.
- Prefix mapped to Ctrl-A for
screenusers.
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.
Installation
Download:
git clone --recursive https://github.com/tony/tmux-config.git ~/.tmuxCopy tmux config to home:
ln -s ~/.tmux/.tmux.conf ~/.tmux.confGo to config dir:
cd ~/.tmuxStats
tmux-mem-cpu-load
Works on Linux and OS X.
Prep ourself to download submodule (if you forgot --recursive when cloning):
git submodule initDownload submodule:
git submodule updateChange dir to tmux-mem-cpu-load:
cd ~/.tmux/vendor/tmux-mem-cpu-loadMake ___build directory and cd into it:
mkdir build; cd buildGeneral make file:
cmake ..Compile binary:
makeInstall 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:
tmuxAnd press Control + a then d to go back to the terminal.
Update config:
tmux source-file ~/.tmux.confbasic-cpu-and-memory.tmux
(Cross platform, tested with python 2.7+)
Update March 19, 2014. Works with psutil 2.0 now.
Install psutil:
sudo pip install psutilCopy ~/.tmux/vendor/basic-cpu-and-memory.tmux to bin:
sudo cp ~/.tmux/vendor/basic-cpu-and-memory.tmux /usr/local/bin/tmux-mem-cpu-loadmake executable:
sudo chmod +x /usr/local/bin/tmux-mem-cpu-loadPowerline (Advanced)
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'Start tmux
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
Commands
Our prefix/leader key is Control + a now (just like the screen multiplexer). This sequence must be typed before any tmux shortcut.
Control + abefore any commandControl + athen?to bring up list of keyboard shortcutsControl + athen"to split windowControl + athen<Space>to change pane arrangementControl + athenoto rotate panesControl + athenh,j,k,lto move left, down, up, right. Respectively. (vim hjkl)Control + athen;to go to last panel
Beyond your first window:
Control + athencto create a new windowControl + athennto next windowControl + athenpto previous windowControl + athen[0-9]move to window numberControl + athen&to kill window
Custom:
Control + athenmto switch tomain-horizontallayout with the main window at 2/3 height..Control + athenMto switch tomain-verticallayout with the main window at half width.
More configs / Tools
- Save / Load your tmux workspaces through JSON or YAML with tmuxp.
- Clone + Synchronize your git / hg / svn projects through JSON / YAML with vcspull.
- Modular, Lazy-loading vim configuration with support for C, C++, Python, Go and Javascript with tony/vim-config
- Modular dot-config example tony/.dot-config
Other
- Github: http://www.github.com/tony
- Website: http://www.git-pull.com
- LICENSE: MIT
- Author: Tony Narlock (tony@git-pull.com)