Jump to a project (git repository), or open one in your editor, from Fish.
-
Finds projects from
$PROJECT_PATHS,ghq,ghr,goghor$XDG_PROJECTS_DIR. -
Skips linked worktrees, each project shows up once, at its main worktree.
-
Opens projects in Zed, VS Code, IntelliJ IDEA,
$VISUALor$EDITOR. -
Uses
zoxide,zorz.luato rank projects by frecency (optional). -
No setup needed.
- Fish 4.0 or later.
Install with Fisher:
fisher install mehcode/pj.fishJump to the highest-ranked project matching a keyword, among the directories you've visited.
Uses
zoxide,zorz.lua. If nothing you've visited is a project that matches,pjopens the picker with your keywords as the query.
pj dotfiles
pj ~/dotfiles/fish # Jumps to a project path.Pick from every project, with the ones you visit most at the top.
pjOpen a project in your editor. pjo takes the same keywords as pj,
and so do pj open and pj --open (-o).
pjo dotfiles
pj open dotfiles
pj --open dotfiles
pjo . # Opens the current project directory.Print a project's path instead of jumping to it, with pj --echo (-e).
With no keywords it opens the picker and prints the one you pick.
ls (pj --echo dotfiles)Complete a project's path with Tab, then the directories inside it.
pj dotf<Tab> # Completes ~/dotfiles/ from part of its name.
pj ~/dotfiles/<Tab> # Lists the directories inside it.pj will only jump to a project's main worktree (the one with a .git directory).
-
The picker lists each project once, regardless of how many worktrees it has.
-
pj applands inappeven ifapp.featureis ranked higher.
The directories to scan for projects.
Defaults to asking the project root from $PROJECT_PATHS, ghq, ghr or gogh;
falling back to $XDG_PROJECTS_DIR.
set --global pj_root ~/src ~/workThe command that ranks the directories you've visited. It gets your keywords as arguments and prints matching directories one per line, highest-ranked first. With no keywords, it prints every directory it knows.
Defaults to zoxide, z or z.lua.
Reads one project per line on stdin and prints the line you chose, unchanged. Printing anything else counts as a cancel. It gets your keywords as its last argument, empty when there are none, so end it with your finder's query flag.
Defaults to fzf, sk, tv or gum.
set --global pj_find_cmd fzf --height 40% --reverse --queryThe command pjo, pj open and pj --open open a project with.
It gets the project's directory as its last argument.
Defaults to the first of Zed, VS Code or IntelliJ IDEA that's installed,
then $VISUAL, then $EDITOR.
set --global pj_open_cmd code --new-windowLicensed under the MIT License.