26bef0942ba8acbe3ad2005500efd8f47e1edc36

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

Add Readme to pj plugin

Diff

 1diff --git a/plugins/pj/README.md b/plugins/pj/README.md
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..27e5638ec67ce178f860c34dc981446c4a318961
 4--- /dev/null
 5+++ b/plugins/pj/README.md
 6@@ -0,0 +1,45 @@
 7+# pj
 8+
 9+The `pj` plugin (short for `Project Jump`) allows you to define several
10+folders where you store your projects, so that you can jump there directly
11+by just using the name of the project directory.
12+
13+Original idea and code by Jan De Poorter ([@DefV](https://github.com/DefV))
14+Source: https://gist.github.com/pjaspers/368394#gistcomment-1016
15+
16+## Usage
17+
18+1. Enable the `pj` plugin:
19+
20+   ```zsh
21+   plugins=(... pj)
22+   ```
23+
24+2. Set `$PROJECT_PATHS` in your ~/.zshrc:
25+
26+   ```zsh
27+   PROJECT_PATHS=(~/src ~/work ~/"dir with spaces")
28+   ```
29+
30+You can now use one of the following commands:
31+
32+##### `pj my-project`:
33+
34+`cd` to the directory named "my-project" found in one of the `$PROJECT_PATHS`
35+directories. If there are several directories named the same, the first one
36+to appear in `$PROJECT_PATHS` has preference.
37+
38+For example:
39+```zsh
40+PROJECT_PATHS=(~/code ~/work)
41+$ ls ~/code    # ~/code/blog ~/code/react
42+$ ls ~/work    # ~/work/blog ~/work/project
43+$ pj blog      # <-- will cd to ~/code/blog
44+```
45+
46+##### `pjo my-project`
47+
48+Open the project directory with your defined `$EDITOR`. This follows the same
49+directory rules as the `pj` command above.
50+
51+Note: `pjo` is an alias of `pj open`.