1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2025-12-15 16:23:15 +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() { function pj() {
local cmd="cd" local cmd="cd"
local project="$1" local project=""
local editor="${EDITOR}"
if [[ "open" == "$project" ]]; then if [[ "$1" == "open" ]]; then
shift shift
project=$* project="$1"
cmd=${=EDITOR} shift
[[ -n "$1" ]] && editor="$1"
cmd="$editor"
else else
project=$* project="$*"
fi fi
for basedir ($PROJECT_PATHS); do for basedir in $PROJECT_PATHS; do
if [[ -d "$basedir/$project" ]]; then if [[ -d "$basedir/$project" ]]; then
$cmd "$basedir/$project" $cmd "$basedir/$project"
return return