Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
67cc59b4
Unverified
Commit
67cc59b4
authored
Jan 05, 2022
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style: some code style fixes
parent
7ae4f76f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
44 deletions
+39
-44
frontend-search.plugin.zsh
plugins/frontend-search/frontend-search.plugin.zsh
+15
-17
pj.plugin.zsh
plugins/pj/pj.plugin.zsh
+24
-27
No files found.
plugins/frontend-search/frontend-search.plugin.zsh
View file @
67cc59b4
...
...
@@ -39,7 +39,7 @@ function frontend() {
emulate
-L
zsh
# define search context URLS
typeset
-A
urls
local
-A
urls
urls
=(
angular
'https://angular.io/?search='
angularjs
$(
_frontend_fallback
'angularjs.org'
)
...
...
@@ -73,25 +73,23 @@ function frontend() {
)
# show help for command list
if
[[
$#
-lt
2
]]
then
print
-P
"Usage: frontend %Ucontext%u %Uterm%u [...%Umore%u] (or just: %Ucontext%u %Uterm%u [...%Umore%u])"
print
-P
""
print
-P
"%Uterm%u and what follows is what will be searched for in the %Ucontext%u website,"
print
-P
"and %Ucontext%u is one of the following:"
print
-P
""
print
-P
" angular, angularjs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow, packagephobia"
print
-P
" dartlang, emberjs, fontello, flowtype, github, html5please, jestjs, jquery, lodash,"
print
-P
" mdn, npmjs, nodejs, qunit, reactjs, smacss, stackoverflow, unheap, vuejs, bundlephobia"
print
-P
""
print
-P
"For example: frontend npmjs mocha (or just: npmjs mocha)."
print
-P
""
return
1
if
[[
$#
-lt
2
]]
;
then
print
-P
"Usage: frontend %Ucontext%u %Uterm%u [...%Umore%u] (or just: %Ucontext%u %Uterm%u [...%Umore%u])"
print
-P
""
print
-P
"%Uterm%u and what follows is what will be searched for in the %Ucontext%u website,"
print
-P
"and %Ucontext%u is one of the following:"
print
-P
""
print
-P
" angular, angularjs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow, packagephobia"
print
-P
" dartlang, emberjs, fontello, flowtype, github, html5please, jestjs, jquery, lodash,"
print
-P
" mdn, npmjs, nodejs, qunit, reactjs, smacss, stackoverflow, unheap, vuejs, bundlephobia"
print
-P
""
print
-P
"For example: frontend npmjs mocha (or just: npmjs mocha)."
print
-P
""
return
1
fi
# check whether the search context is supported
if
[[
-z
"
$urls
[
$1
]"
]]
then
if
[[
-z
"
$urls
[
$1
]"
]]
;
then
echo
"Search context
\"
$1
\"
currently not supported."
echo
""
echo
"Valid contexts are:"
...
...
plugins/pj/pj.plugin.zsh
View file @
67cc59b4
alias
pjo
=
"pj open"
pj
()
{
emulate
-L
zsh
cmd
=
"cd"
project
=
$1
if
[[
"open"
==
"
$project
"
]]
;
then
shift
project
=
$*
cmd
=
${
=EDITOR
}
else
project
=
$*
function
pj
()
{
local
cmd
=
"cd"
local
project
=
"
$1
"
if
[[
"open"
==
"
$project
"
]]
;
then
shift
project
=
$*
cmd
=
${
=EDITOR
}
else
project
=
$*
fi
for
basedir
(
$PROJECT_PATHS
)
;
do
if
[[
-d
"
$basedir
/
$project
"
]]
;
then
$cmd
"
$basedir
/
$project
"
return
fi
done
for
basedir
(
$PROJECT_PATHS
)
;
do
if
[[
-d
"
$basedir
/
$project
"
]]
;
then
$cmd
"
$basedir
/
$project
"
return
fi
done
echo
"No such project '
${
project
}
'."
echo
"No such project '
${
project
}
'."
}
_pj
()
{
emulate
-L
zsh
local
-a
projects
for
basedir
(
$PROJECT_PATHS
)
;
do
projects+
=(
${
basedir
}
/
*
(
/N
))
done
typeset
-a
projects
for
basedir
(
$PROJECT_PATHS
)
;
do
projects+
=(
${
basedir
}
/
*
(
/N
))
done
compadd
${
projects
:t
}
compadd
${
projects
:t
}
}
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