Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
ed011228
Commit
ed011228
authored
Nov 06, 2014
by
Robby Russell
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1604 from franklouwers/master
Improve pj-plugin to support projects with spaces in their names + optimise code
parents
548b9c44
bce74975
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
pj.plugin.zsh
plugins/pj/pj.plugin.zsh
+9
-2
No files found.
plugins/pj/pj.plugin.zsh
View file @
ed011228
...
...
@@ -18,8 +18,11 @@ function pj() {
file
=
$1
if
[[
"open"
==
"
$file
"
]]
then
file
=
$2
shift
file
=
$*
cmd
=(
${
(s
:
:
)EDITOR
}
)
else
file
=
$*
fi
for
project
in
$PROJECT_PATHS
;
do
...
...
@@ -36,7 +39,11 @@ function pj() {
alias
pjo
=
"pj open"
function
_pj
()
{
compadd
`
/bin/ls
-l
$PROJECT_PATHS
2>/dev/null |
awk
'{ print $9 }'
`
# might be possible to improve this using glob, without the basename trick
typeset
-a
projects
projects
=(
$PROJECT_PATHS
/
*
)
projects
=
$projects
:t
_arguments
'*:file:($projects)'
}
compdef _pj pj
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment