code-activator/README.md

47 lines
2.3 KiB
Markdown
Raw Normal View History

2021-09-15 00:15:18 +00:00
# Code Activator
##### *A `zsh` utility for terminal-based project navigation*
2021-11-09 23:48:14 +00:00
[![Generic badge](https://img.shields.io/badge/junegunn-fzf-blueviolet.svg)](https://github.com/junegunn/fzf)
2022-01-03 22:08:13 +00:00
[![Generic badge](https://img.shields.io/badge/stedolan-jq-blueviolet.svg)](https://github.com/jq/)
2021-11-09 23:48:14 +00:00
2022-01-03 22:08:13 +00:00
Code Activator provides fast project navigation in the terminal through both an API and CLI.
2021-11-09 23:48:14 +00:00
2022-01-04 22:14:05 +00:00
![Visual Demo](./docs/demo.gif "Example usage to jump to code-activator's source!")
## Contributing
See our [contributing guide](./docs/CONTRIBUTING.md) and [code of conduct](./docs/CODE_OF_CONDUCT.md).
2021-11-09 23:48:14 +00:00
## Installation
2022-01-03 22:08:13 +00:00
1. install dependencies [junegunn/fzf](https://github.com/junegunn/fzf) and [stedolan/jq](https://github.com/stedolan/jq)
1. clone this repo, and source the `activator.plugin.zsh` in your `zshrc`:
2021-11-09 23:48:14 +00:00
```shell
# replace <path-to>/code-activator with the appropriate path
git clone https://github.com/w0ryn/code-activator-zsh.git <path-to>/code-activator
echo 'source <path-to>/code-activator' >> $HOME/.zshrc
```
2022-01-03 22:08:13 +00:00
By default, Code Activator looks for projects in `~/Projects/GitHub` and `~/Projects/BitBucket`, but you can configure\* this in your `~/.config/code-activator-zsh/settings.zsh`.
It is highly recommended that, if nothing else, you configure `CA__DIRS` to group your projects as you please.
2021-11-09 23:48:14 +00:00
2022-01-03 22:08:13 +00:00
<sup>\**the configuration file is created the first time Code Activator is sourced*</sup>
2021-11-09 23:48:14 +00:00
2022-01-03 22:08:13 +00:00
## Usage
Code Activator commands can be invoked one of three ways:
1. directly (`code-activator`; intended for use as an API)
2. through an alias (`lkj` by default)
3. through a shortcut (`CTRL+SPACE` by default; creates a zsh-plugin)
2021-11-09 23:48:14 +00:00
2022-01-03 22:08:13 +00:00
With no argument, Code Activator provides a list of all available projects.
Select one to activate it's environment and jump to the project's root.
If your first argument to Code Activator is a project name, the specified project will be activated.
You can also `deactivate` an activated project, `clone` an existing project, or create a `new` project (with the appropriate command).
## Custom Environment
Although not exactly a virtual environment, Code Activator creates a `custom-env` for projects where you can set project-specific environment variables or shell functions.
It also provides a `__RESTORE__` syntax to allow safe manipulation of `PATH` or other variables when activating a project.
See [the custom-env template](./.env.zsh) for more details.
2021-11-09 23:48:14 +00:00