Giter Club home page Giter Club logo

ohmytmux's Introduction

OhMyTmux

Bash script to install Tmux, ZSH and other of my favorite tools. Autoconfigures tmux to work with ZSH, adds oh-my-zsh and useful plugins.

Introduction

Tmux is a "terminal multiplexer", it enables a number of terminals (or windows) to be accessed and controlled from a single terminal. It allows you to create a session on a remote box, run applications in that remote session, "detach" from the session, and re-"attach" when desired. It also has advanced features such as multiple windows and split views.

The Z shell (Zsh) is a Unix shell that can be used as an interactive login shell and as a command interpreter for shell scripting. Zsh is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh.

Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration.

So, what is OhMyTmux? It is an automated script that installs these tools and some more, and auto configures them to launch with your terminal. This means that when you open you terminal application (or SSH), it will launch a TMUX session, and each panel will load ZSH.

Please, use at your own risk.

Currently tested working in fresh installs of latest versions (as of January 2023) of:

  • Manjaro
  • EndeavourOS
  • Ubuntu Mate
  • Termux
  • Parrot
  • Kali

This is recommended for fresh/new machines, as it may break your current installation. It backups and replaces previous .zshrc and .tmux.conf files, and .tmux and .oh-my-zsh folders.

Installs and configures the following tools:

  • ZSH (it is set as default shell)
  • oh-my-zsh (with "agnoster" theme set)
  • oh-my-zsh Autosuggestions and Syntax Highlighting plugins
  • TMUX (autostarting ZSH with oh-my-zsh)
  • TPM: TMUX Plugin Manager
  • TMUX-Continuum: Tmux Plugin to resurrect previous session after a reboot or logout
  • TMUX Better Mouse Plugin: Tmux Plugin to improve Tmux's built-in mouse mode
  • TMUX Yank: auto copy to clipboard when mouse selecting in TMUX
  • Bat: an improved cat (no line number mode)
  • TLDR: simplifies man pages with examples
  • Flameshot: a powerful screenshot saver
  • nano: Configures syntax highlighting
  • Nerd Fonts: Installs "Nerd Fonts" patched fonts (currently only for Arch*)

It also includes some aliases and useful commands I usually use. Check ~/.zshrc file to see them.

OhMyTmux on a Ubuntu Mate 20.04 fresh install:

ohmytmux_ubuntumate

OhMyTmux on Termux v0.118:

ohmytmux_termux

*On other distros, you may need to download a patched font of your choice from Nerd Fonts. Please, refer to the Troubleshooting section.

Installation

Download the raw ohmytmux.sh file or clone the repository, then run with:

chmod +x ohmytmux.sh
./ohmytmux.sh

You also can execute it automatically with curl:

bash -c "$(curl -fsSL https://github.com/rlvilla/OhMyTmux/raw/main/ohmytmux.sh)"

or wget:

bash <(wget -qO - https://github.com/rlvilla/OhMyTmux/raw/main/ohmytmux.sh)

Manuals and Cheatsheets

To see all the available shortcuts in TMUX, press and release PREFIX (default is Ctrl+B) and ?

TMUX Cheatsheet:

https://tmuxcheatsheet.com/


Oh My Zsh Cheatsheet:

https://github.com/ohmyzsh/ohmyzsh/wiki/Cheatsheet

Auto Uninstall

This will backup .tmux and .oh-my-zsh folders, and .tmux.conf and .zshrc files. It also will try to restore previous versions backed up by the installation script.

Download the raw uninstall_ohmytmux.sh file or clone the repository, then run with:

chmod +x uninstall_ohmytmux.sh
./uninstall_ohmytmux.sh

You also can execute it automatically with wget:

bash <(wget -qO - https://github.com/rlvilla/OhMyTmux/raw/main/uninstall_ohmytmux.sh)

or curl:

bash -c "$(curl -fsSL https://github.com/rlvilla/OhMyTmux/raw/main/uninstall_ohmytmux.sh)"

Manual Uninstall

This will wipe configurations made by the script and oh-my-tmux and TMUX Plugin Manager (TPM).

Remove ~/.oh-my-zsh and ~/.tmux folders, and ~/.tmux.conf ~/.zshrc files.

To recover previous ~/.tmux.conf and ~/.zshrc files, rename the auto backup done by the script with the first installation of ohmytmux back to ~/.tmux.conf and ~/.zshrc respectively.

Troubleshooting

Depending on the system, terminal may not execute TMUX/ZSH automatically and may need a reboot/logout to apply the changes to the default shell.

If some symbols are missing, you may need to download a Nerd Font patched font. Download a font of your choice (or the one your terminal app is currently using) from:

https://github.com/ryanoasis/nerd-fonts

If you don't want to download a font and also don't want to see broken characters in the theme, disable tmux-power theme in ~/.tmux.conf by commenting the set -g @plugin 'rlvilla/tmux-power' line with a #.

Development

Currently testing a custom made oh-my-zsh 'agnoster' theme with timestamp to the right. Enable it by commenting the sed -i 's/="robbyrussell"/="agnoster"/' ~/.zshrc line and uncommenting the next curl and sed commands. Also with:

bash -c "$(curl -fsSL https://github.com/rlvilla/OhMyTmux/raw/main/ohmytmux.sh)" -s testing

References

Some parts of the code and ideas are borrowed from:

https://github.com/Cabbagec/termux-ohmyzsh/

tmux-plugins/tpm#6

https://github.com/nhdaly/tmux-better-mouse-mode

https://gist.github.com/Neo-Oli/8c5dcb1c75b59b8bf4474105f758e9ca

https://gist.github.com/william8th/faf23d311fc842be698a1d80737d9631

ohmytmux's People

Contributors

rlvilla avatar

Stargazers

 avatar  avatar  avatar Frederick Pellerin avatar Omar Lukach avatar Peter Reginald avatar Axel  avatar Migue27au avatar Rafael Pernil avatar - avatar

Watchers

 avatar

Forkers

rain-yjt

ohmytmux's Issues

Fix Resurrect/Continuum autosave

Continuum wont autosave because tmux-power theme resets the status-right variable
Fix: define tmux-power plugin before resurrect/continuum in .tmux.conf

Tmux cheatsheet

It would be great if you could add a short cheatsheet of the tmux instructions.

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.