Coder Social home page Coder Social logo

tony / tmux-config Goto Github PK

View Code? Open in Web Editor NEW
1.8K 65.0 478.0 405 KB

:green_book: Example tmux configuration - screen + vim key-bindings, system stat, cpu load bar.

Home Page: http://tony.github.com/tmux-config/

Shell 100.00%
tmux dot-config dotfiles dotfile configuration shell terminal

tmux-config's Introduction

tmux is a terminal multiplexer.

  • Tested with tmux 1.5+.
  • Support for tmux-mem-cpu-load.
  • Prefix mapped to Ctrl-A for 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.

Share your .dot-configs

Have a tmux configuration you'd like to share? Whether a fork of this project, another's, or your own, submit it to awesome-tmux-configs.

Installation

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

Stats

tmux-mem-cpu-load

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

basic-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 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

Powerline (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 + a before any command
  • Control + a then ? to bring up list of keyboard shortcuts
  • Control + a then " to split window
  • Control + a then <Space> to change pane arrangement
  • Control + a then o to rotate panes
  • Control + a then h, j, k, l to move left, down, up, right. Respectively. (vim hjkl)
  • Control + a then ; to go to last panel

Beyond your first window:

  • Control + a then c to create a new window
  • Control + a then n to next window
  • Control + a then p to previous window
  • Control + a then [0-9] move to window number
  • Control + a then & to kill window

Custom:

  • 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.

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

tmux-config's People

Contributors

benoittgt avatar fabioperez avatar guoyk93 avatar h3nnn4n avatar hadesgames avatar hellolj avatar magicarbon avatar nukchuk avatar sdbruder avatar tony avatar yankeguo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tmux-config's Issues

mouse scroll option?

hey, I know that masters don't use mouses in general when in terminal, but scrolling up with a mouse wheel would be more intuitive to the novices that are getting used to tmux.

So I suggest to add the option of:

#mouse wheel is used to scroll up history wise
set -g mouse on

basic-cpu-and-memory.tmux

I have tried out this tmux.conf with "basic-cpu-and-memory.tmux", but I do not get where does it take the CPU load data and MEM usage data? It is different, from what is displayed in "htop".

Also, I do not know why, but on Raspberry Pi 1, after installing this add-ons "htop" showed inreased cpu usage :( So I had to remove them all. Not sure if that was caused by "basic-cpu-and-memory.tmux"

http://www.bildites.lv/images/ofyvheug2fof3j1zpqo.png

Powerline only shows cpu stats

Hi. I installed the config, and added powerline with pip. Got 'powerline-config tmux setup' returned 127 error. Tried to run the daemon, but said it wasn't installed, so I installed it with sudo apt-get install powerline.

The powerline now works great, except I can only see the cpu stats, and nothing for memory. At least I think that's the case. Here is a screenshot attached. Please advice if I can change this in .tmux.conf or elsewhere.
screenshot from 2016-01-25 22-34-28

tmux 2.9

I was just trying out your config on MacOS using tmux from homebrew, and ran into these errors:

/Users/grahame/.tmux.conf:4: invalid option: status-attr                                                               [0/0]
/Users/grahame/.tmux.conf:12: invalid option: window-status-fg
/Users/grahame/.tmux.conf:13: invalid option: window-status-bg
/Users/grahame/.tmux.conf:17: invalid option: window-status-current-fg
/Users/grahame/.tmux.conf:18: invalid option: window-status-current-bg
/Users/grahame/.tmux.conf:22: invalid option: pane-border-fg
/Users/grahame/.tmux.conf:23: invalid option: pane-active-border-fg
/Users/grahame/.tmux.conf:26: invalid option: message-bg
/Users/grahame/.tmux.conf:27: invalid option: message-fg

tmux 2.9 only just came out (three days ago), looks like the changes made to style config have broken things:
https://github.com/tmux/tmux/blob/master/CHANGES#L27

(thanks for the example config!)

.tmux.conf:94: usage: send-keys [-lRM] [-t target-pane] key ...

OS: Debian 9.0
tmux version: 2.3-4

The problem seems to be with these lines of code:
# Vi copypaste mode set-window-option -g mode-keys vi if-shell "test '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -ge 4 \)'" 'bind-key -Tcopy-mode-vi v send -X begin-selection; bind-key -Tcopy-mode-vi y send -X copy-selection-and-cancel' if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -lt 4\) -o #{$TMUX_VERSION_MAJOR} -le 1' 'bind-key -t vi-copy v begin-selection; bind-key -t vi-copy y copy-selection'

unknown option: status-utf8

Since latest update of tmux, 2.2, I get this error everytime on startup.
~/.tmux.conf:91: unknown option: status-utf8
seems it no longer necessary to set utf8 manually.
tmux/tmux#230

tmux pane does not respond

Sometimes (it seems random), my tmux panes do not respond to any command after it finishes running a command.

For example, after I run ls, the tmux does not respond to any key despite printing everything that I type. Ctrl+C does nothing.

enter image description here

I use zsh as my default shell. I'm not sure if this is a bug with zsh or tmux. Anyone knows a solution for this?

My setup:

tmux 2.2 (also tested with tmux 1.8)
zsh 5.0.2 (x86_64-pc-linux-gnu) (with Prezto)

This issue was firstly posted to tmux repo, but I could not reproduce using without the tmux.conf. Also, maybe this is a problem with zsh.

Powerline :(

The powerline status not working for me, I am using Ubuntu 14.04...I have powerline fonts instaled.

syntax error

I'm getting a syntax error on line 100

~/.tmux.conf:100: syntax error

"C-a c" new behavior

Hello,

Since tmux 1.9 got out, the behavior of "C-a c" has changed. It used to create a new window in the same directory as the current window; now, instead, it creates a new window in home. I'm not really sure if people would like to get the same behavior as before or they are fine with the current one, but I've personally added the following keybinding:

bind c new-window -c '#{pane_current_path}'

You might want to consider it :).

Take care and thank you for your effort with the project,

Adria

syntax error on tmux 3.0a

There is an error when running under tmux 3.0a as follows:
.tmux.conf:100: syntax error

Could you look into it?

Need a way to test config changes in older tmux versions

We have a list of pull requests, the issue is, if we introduce a tmux config suggestion, it could potentially break behavior with other tmux versions.

Sometimes this may be obvious enough to catch (e.g. syntax level raising an error) but other times it may be behavioral and more difficult to test.

vendor/tmux-mem-cpu-load should follow branch

Hi Tony,

could you set the tmux-mem-cpu-load submodule to follow the master branch of https://github.com/thewtex/tmux-mem-cpu-load?

Alternatively you could change one line in the README:

git submodule update --remote

You see the args changed in the tmux.conf for tmux-mem-cpu-load with commit 0d6943e, but the submodule follows an old version. Therefore, on a fresh install tmux-mem-cpu-load doesn't seem to work. Might be frustrating for a new user.

Thank you in advance.

Best regards,
Krzysztof

New update breaks colors

Hey Tony,

Just saw that the latest version of your conf breaks the base16 color scheme. I have reverted back to the old scheme (I'm guessing prior to the last update) and it seems to have fixed the issue.

Looking for maintainers

I'm looking for people who are familiar with linux/macOS that can answer issues, pull requests and keep this config updated with the times.

If you're interested and have the spare time to help maintain, and can QA changes on macOS, linux, and older tmux versions, get in touch here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.