my xfce4 dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.1 KiB

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