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
eea77b7c
Commit
eea77b7c
authored
Apr 18, 2015
by
Will Mendes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add stackoverflow link
parent
75b9030f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
README.md
plugins/frontend-search/README.md
+2
-0
frontend-search.plugin.zsh
plugins/frontend-search/frontend-search.plugin.zsh
+8
-1
No files found.
plugins/frontend-search/README.md
View file @
eea77b7c
...
...
@@ -47,6 +47,7 @@ The search content are
*
`angularjs <google.com/search?as_q=<search-term>&as_sitesearch=angularjs.org>`
*
`reactjs <google.com/search?as_q=<search-term>&as_sitesearch=facebook.github.io/react>`
*
`emberjs <emberjs.com>`
*
`stackoverflow <stackoverflow.com>`
## Aliases ##
...
...
@@ -72,6 +73,7 @@ There are a few aliases presented as well:
*
`angularjs`
A shorthand for
`frontend angularjs`
*
`reactjs`
A shorthand for
`frontend reactjs`
*
`emberjs`
A shorthand for
`frontend emberjs`
*
`stackoverflow`
A shorthand for
`frontend stackoverflow`
## Author
...
...
plugins/frontend-search/frontend-search.plugin.zsh
View file @
eea77b7c
...
...
@@ -17,7 +17,7 @@ function frontend() {
fi
# 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)'
]]
;
if
[[
!
$1
=
~
'(jquery|mdn|compass|html5please|caniuse|aurajs|dartlang|qunit|fontello|bootsnipp|cssflow|codepen|unheap|bem|smacss|angularjs|reactjs|emberjs
|stackoverflow
)'
]]
;
then
echo
"Search valid search content
$1
not supported."
echo
"Valid contents: (formats 'frontend <search-content>' or '<search-content>')"
...
...
@@ -40,6 +40,7 @@ function frontend() {
echo
"* angularjs"
echo
"* reactjs"
echo
"* emberjs"
echo
"* stackoverflow"
echo
""
return
1
...
...
@@ -103,6 +104,9 @@ function frontend() {
"emberjs"
)
url
=
"
${
url
}
emberjs.com"
url
=
"
${
url
}
/api/#stq=
$2
&stp=1"
;;
"stackoverflow"
)
url
=
"
${
url
}
https://stackoverflow.com"
url
=
"
${
url
}
/search?q=
$2
"
;;
*
)
echo
"INVALID PARAM!"
return
;;
esac
...
...
@@ -149,3 +153,6 @@ alias smacss='frontend smacss'
alias
angularjs
=
'frontend angularjs'
alias
reactjs
=
'frontend reactjs'
alias
emberjs
=
'frontend emberjs'
# search websites
alias
stackoverflow
=
'frontend stackoverflow'
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