Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pj.fish

Jump to a project (git repository), or open one in your editor, from Fish.

Installation

Install with Fisher:

fisher install mehcode/pj.fish

Quickstart

Jump to the best match for a keyword among the directories you've visited.

Uses zoxide, z or z.lua. If nothing you've visited is a project that matches, pj opens the picker with your keywords as the query.

pj dotfiles

Pick from every project, with the ones you visit most at the top.

pj

Open a project in your editor. pjo takes the same keywords as pj.

pjo dotfiles

Press Tab after pj or pjo to complete a project's name.

Worktrees

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 app lands in app even if app.feature is ranked higher.

Configuration

$pj_root

The directories to scan for projects.

Defaults to asking the project root from ghq, ghr or gogh; falling back to $XDG_PROJECTS_DIR.

set --universal pj_root ~/src ~/work

$pj_query_cmd

The command that ranks the directories you've visited. It gets your keywords as arguments and prints matching directories one per line, best first. With no keywords, it prints every directory it knows.

Defaults to zoxide, z or z.lua.

$pj_find_cmd

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 --universal pj_find_cmd fzf --height 40% --reverse --query

$pj_open_cmd

The command pjo opens 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 --universal pj_open_cmd code --new-window

License

Licensed under the MIT License.

About

Jump to a project (git repository), or open one in your editor, from Fish.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages