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
0a808898
Commit
0a808898
authored
Aug 29, 2015
by
Will Mendes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Frontend-search: add search in npm website
parent
192de6bc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
README.md
plugins/frontend-search/README.md
+2
-0
_frontend-search.sh
plugins/frontend-search/_frontend-search.sh
+4
-0
frontend-search.plugin.zsh
plugins/frontend-search/frontend-search.plugin.zsh
+6
-1
No files found.
plugins/frontend-search/README.md
View file @
0a808898
...
@@ -43,6 +43,7 @@ The search content are
...
@@ -43,6 +43,7 @@ The search content are
*
`reactjs <google.com/search?as_q=<search-term>&as_sitesearch=facebook.github.io/react>`
*
`reactjs <google.com/search?as_q=<search-term>&as_sitesearch=facebook.github.io/react>`
*
`emberjs <emberjs.com>`
*
`emberjs <emberjs.com>`
*
`stackoverflow <stackoverflow.com>`
*
`stackoverflow <stackoverflow.com>`
*
`npmjs <npmjs.com>`
## Aliases ##
## Aliases ##
...
@@ -69,6 +70,7 @@ There are a few aliases presented as well:
...
@@ -69,6 +70,7 @@ There are a few aliases presented as well:
*
`reactjs`
A shorthand for
`frontend reactjs`
*
`reactjs`
A shorthand for
`frontend reactjs`
*
`emberjs`
A shorthand for
`frontend emberjs`
*
`emberjs`
A shorthand for
`frontend emberjs`
*
`stackoverflow`
A shorthand for
`frontend stackoverflow`
*
`stackoverflow`
A shorthand for
`frontend stackoverflow`
*
`npmjs`
A shorthand for
`frontend npmjs`
## Author
## Author
...
...
plugins/frontend-search/_frontend-search.sh
View file @
0a808898
...
@@ -37,6 +37,7 @@ function _frontend() {
...
@@ -37,6 +37,7 @@ function _frontend() {
'reactjs: Search in React website'
'reactjs: Search in React website'
'emberjs: Search in Ember website'
'emberjs: Search in Ember website'
'stackoverflow: Search in StackOverflow website'
'stackoverflow: Search in StackOverflow website'
'npmjs: Search in NPMJS website'
)
)
_arguments
-C
\
_arguments
-C
\
...
@@ -110,6 +111,9 @@ function _frontend() {
...
@@ -110,6 +111,9 @@ function _frontend() {
stackoverflow
)
stackoverflow
)
_describe
-t
points
"Warp points"
frontend_points
&&
ret
=
0
_describe
-t
points
"Warp points"
frontend_points
&&
ret
=
0
;;
;;
npmjs
)
_describe
-t
points
"Warp points"
frontend_points
&&
ret
=
0
;;
esac
esac
;;
;;
esac
esac
...
...
plugins/frontend-search/frontend-search.plugin.zsh
View file @
0a808898
...
@@ -9,7 +9,7 @@ function frontend() {
...
@@ -9,7 +9,7 @@ function frontend() {
fi
fi
# check whether the search engine is supported
# check whether the search engine is supported
if
[[
!
$1
=
~
'(jquery|mdn|compass|html5please|caniuse|aurajs|dartlang|qunit|fontello|bootsnipp|cssflow|codepen|unheap|bem|smacss|angularjs|reactjs|emberjs|stackoverflow)'
]]
;
if
[[
!
$1
=
~
'(jquery|mdn|compass|html5please|caniuse|aurajs|dartlang|qunit|fontello|bootsnipp|cssflow|codepen|unheap|bem|smacss|angularjs|reactjs|emberjs|stackoverflow
|npmjs
)'
]]
;
then
then
echo
"Search valid search content
$1
not supported."
echo
"Search valid search content
$1
not supported."
echo
"Valid contents: (formats 'frontend <search-content>' or '<search-content>')"
echo
"Valid contents: (formats 'frontend <search-content>' or '<search-content>')"
...
@@ -33,6 +33,7 @@ function frontend() {
...
@@ -33,6 +33,7 @@ function frontend() {
echo
"* reactjs"
echo
"* reactjs"
echo
"* emberjs"
echo
"* emberjs"
echo
"* stackoverflow"
echo
"* stackoverflow"
echo
"* npmjs"
echo
""
echo
""
return
1
return
1
...
@@ -99,6 +100,9 @@ function frontend() {
...
@@ -99,6 +100,9 @@ function frontend() {
"stackoverflow"
)
"stackoverflow"
)
url
=
"
${
url
}
stackoverflow.com"
url
=
"
${
url
}
stackoverflow.com"
url
=
"
${
url
}
/search?q=
$2
"
;;
url
=
"
${
url
}
/search?q=
$2
"
;;
"npmjs"
)
url
=
"
${
url
}
www.npmjs.com"
url
=
"
${
url
}
/search?q=
$2
"
;;
*
)
echo
"INVALID PARAM!"
*
)
echo
"INVALID PARAM!"
return
;;
return
;;
esac
esac
...
@@ -148,3 +152,4 @@ alias emberjs='frontend emberjs'
...
@@ -148,3 +152,4 @@ alias emberjs='frontend emberjs'
# search websites
# search websites
alias
stackoverflow
=
'frontend stackoverflow'
alias
stackoverflow
=
'frontend stackoverflow'
alias
npmjs
=
'frontend npmjs'
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