1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2025-12-13 16:04:08 +08:00

Update pj.plugin.zsh with editor arg for pjo

This commit is contained in:
avycado13 2025-06-26 15:20:37 +05:30 committed by GitHub
parent 01433503c2
commit ebfed84457
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,17 +2,20 @@ alias pjo="pj open"
function pj() {
local cmd="cd"
local project="$1"
local project=""
local editor="${EDITOR}"
if [[ "open" == "$project" ]]; then
if [[ "$1" == "open" ]]; then
shift
project=$*
cmd=${=EDITOR}
project="$1"
shift
[[ -n "$1" ]] && editor="$1"
cmd="$editor"
else
project=$*
project="$*"
fi
for basedir ($PROJECT_PATHS); do
for basedir in $PROJECT_PATHS; do
if [[ -d "$basedir/$project" ]]; then
$cmd "$basedir/$project"
return