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