Workon is a small oh-my-zsh plugin to make context switching less painful. I wrote it because I was getting tired of always switching back and forth between multiple projects and having to manually set up my workspace every time.
It has not been tested much beyond my personal setup, so your mileage may vary.
workon
is exposed as a plugin and must added to your oh-my-zsh plugins
array. workon
uses the concept or workspaces to determine where to look for
projects. These workspaces are specified in a PATH-like syntax and can be
provided before sourcing the function. If not provided, the default is
$HOME/Work
.
If you would rather not use oh-my-zsh, it should still be directly
source
-able.
A simple configuration looks like this: All projects in Work
and Dev
will
be considered by workon
.
export WORKSPACES="$HOME/Work:$HOME/Dev"
You can then use it by typing workon <project>
on the command line.
Each directory in $WORKSPACES
is iterated and a number of sequential checks
are performed. Very similarly to PATH
resolution, the first workspace that
has a successful check will be used to start the new context. As soon as a
check passes, all subsequent workspaces and checks are ignored.
-
.tmuxinator.yml
in project directory -
tmuxinator
project_name.yml
in a workspace -
global tmuxinator project file in
~/.config/tmuxinator
-
Pipfile in the project directory (
pipenv shell
) -
Plain directory fallback (cd only)