Skip to content
/ workon Public

A tiny script to make context switching less painful.

Notifications You must be signed in to change notification settings

alxbl/workon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Workon: Straight to the Point

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.

Usage

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.

How it Works

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.

Currently Supported (ordered by priority)

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

Future Work

The following is a list of things I would like to add at some point:

  • Completion files for ZSH based on contents of workspace directories.

  • Additional Context Support (rvm, node, .env, …​)

  • Support project templates and creation

About

A tiny script to make context switching less painful.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages