Oh My Tmux Manager (OMT Manager) is a shell plugin that helps you to easily manage your Tmux configurations. With OMT Manager, you can install, remove, and upgrade Oh My Tmux with just a few commands.
- Install and setup Oh My Tmux easily
- Customize the installation path of Oh My Tmux and the configuration path of Tmux
- Remove Oh My Tmux and related configurations
- Upgrade Oh My Tmux to the latest version
- Backup and restore user configurations
You can install the OMT Manager using a plugin manager or manually.
-
Zinit / Zi
Add the following content to your
.zshrc
:zinit load Hzbeta/omt-manager
Further, you can use the following config to:
- Lazy load the plugin when you installed Tmux.
- Install Oh My Tmux automatically when the plugin is loaded.
- If Oh My Tmux is already installed, the plugin won't do anything.
zinit ice wait lucid has'tmux' atload'omt install -s' zinit load Hzbeta/omt-manager
-
Oh My Zsh
- Clone the repository into the
$ZSH_CUSTOM/plugins
directory:
git clone https://github.com/Hzbeta/omt-manager.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/omt-manager"
- Add the plugin to the
plugins
array in your.zshrc
:
plugins=(... omt-manager)
- Clone the repository into the
-
Antigen
Add the following line to your
.zshrc
:antigen bundle Hzbeta/omt-manager
-
Zplug
Add the following line to your
.zshrc
:zplug "Hzbeta/omt-manager"
-
Clone the repository:
git clone https://github.com/Hzbeta/omt-manager.git
-
Add the following line to your
.zshrc
(for Zsh) or.bashrc
(for Bash), replacing/path/to/omt-manager.sh
with the actual path to theomt-manager.sh
file in the cloned repository:source /path/to/omt-manager/omt-manager.sh
Use the omt
command to manage your Oh My Tmux installation:
omt [install|remove|upgrade]
omt install
: Install Oh My Tmuxomt remove
: Remove Oh My Tmux and related configurationsomt upgrade
: Upgrade Oh My Tmux to the latest version
-s
: Silent mode, suppress output-f
: Force install, remove existing Oh My Tmux and reinstall, backup and replace existing .tmux.conf-o
: Overwrite user config, backup and replace existing .tmux.conf.local (must be used with -f)-h
: Show help information
-a
: Remove .tmux.conf.local as well (be careful!)-h
: Show help information
-s
: Silent mode, suppress output-o
: Overwrite user config, backup and replace existing .tmux.conf.local-h
: Show help information
The default installation and configuration paths for Oh My Tmux and Tmux are as follows:
# Default installation path of Oh My Tmux
MANAGER_OMT_DIR_PATH="${HOME}/.tmux"
# Default configuration paths for Tmux
MANAGER_OMT_CONF_PATH="${HOME}/.tmux.conf"
MANAGER_OMT_LOCAL_CONF_PATH="${HOME}/.tmux.conf.local"
You can Customize the installation path of Oh My Tmux and the configuration path of Tmux by setting the following environment variables:
# Customize the installation path of Oh My Tmux
export MANAGER_OMT_DIR_PATH="$XDG_CONFIG_HOME/tmux/oh-my-tmux"
# Customize the configuration path of Tmux
export MANAGER_OMT_CONF_PATH="$XDG_CONFIG_HOME/tmux/tmux.conf"
export MANAGER_OMT_LOCAL_CONF_PATH="$XDG_CONFIG_HOME/tmux/tmux.conf.local"
Be cautious when configuring these paths, as this plugin works within the directory of Oh my tmux. If you set the folder path of another Git project as the path for Oh my tmux, that project may become corrupted. Therefore, please double-check your configuration before running any commands related to this plugin.
To develop this plugin, you need to install the following dependencies:
- act: A tool for running GitHub Actions locally.
- shUnit2: A unit test framework for Bash.
- bashcov: A code coverage analysis tool for Bash.
And then, you can run the following commands to start developing:
- Clone the repository.
- Open the repository in your favorite editor.
- Make changes to the code.
- Run
bash ./tests/coverage_report.sh
to test your changes and generate a coverage report, please make sure that the coverage is 100%. - Run
act
to test your changes with GitHub Actions locally. - Push your changes to GitHub and create a Pull Request.
Tips:
- If you are using VS Code, you can use the Dev Container to develop this plugin without installing any dependencies. See here for more details.
- And if you are using WSL2 and Docker Desktop, please run
docker login
in WSL2, before opening Dev Container to avoid thecredsStore
error. - The default Dockerfile does not contain the
act
tool, asact
utilizes Docker itself. If you want to useact
within the Dev Container, you will need to configure Docker in Docker (DinD) or Docker out of Docker (DooD) manually.
This project is released under the Apache License 2.0. See LICENSE for more details.