Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Oh My Zsh
Commits
b4729d3e
Commit
b4729d3e
authored
Apr 22, 2015
by
Robby Russell
Browse files
Merge pull request #3792 from willmendesneto/frontend-search-add-new-repositories
Add stackoverflow search
parents
75b9030f
eea77b7c
Changes
2
Hide whitespace changes
Inline
Side-by-side
plugins/frontend-search/README.md
View file @
b4729d3e
...
@@ -47,6 +47,7 @@ The search content are
...
@@ -47,6 +47,7 @@ The search content are
*
`angularjs <google.com/search?as_q=<search-term>&as_sitesearch=angularjs.org>`
*
`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>`
*
`reactjs <google.com/search?as_q=<search-term>&as_sitesearch=facebook.github.io/react>`
*
`emberjs <emberjs.com>`
*
`emberjs <emberjs.com>`
*
`stackoverflow <stackoverflow.com>`
## Aliases ##
## Aliases ##
...
@@ -72,6 +73,7 @@ There are a few aliases presented as well:
...
@@ -72,6 +73,7 @@ There are a few aliases presented as well:
*
`angularjs`
A shorthand for
`frontend angularjs`
*
`angularjs`
A shorthand for
`frontend angularjs`
*
`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`
## Author
## Author
...
...
plugins/frontend-search/frontend-search.plugin.zsh
View file @
b4729d3e
...
@@ -17,7 +17,7 @@ function frontend() {
...
@@ -17,7 +17,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)'
]]
;
if
[[
!
$1
=
~
'(jquery|mdn|compass|html5please|caniuse|aurajs|dartlang|qunit|fontello|bootsnipp|cssflow|codepen|unheap|bem|smacss|angularjs|reactjs|emberjs
|stackoverflow
)'
]]
;
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>')"
...
@@ -40,6 +40,7 @@ function frontend() {
...
@@ -40,6 +40,7 @@ function frontend() {
echo
"* angularjs"
echo
"* angularjs"
echo
"* reactjs"
echo
"* reactjs"
echo
"* emberjs"
echo
"* emberjs"
echo
"* stackoverflow"
echo
""
echo
""
return
1
return
1
...
@@ -103,6 +104,9 @@ function frontend() {
...
@@ -103,6 +104,9 @@ function frontend() {
"emberjs"
)
"emberjs"
)
url
=
"
${
url
}
emberjs.com"
url
=
"
${
url
}
emberjs.com"
url
=
"
${
url
}
/api/#stq=
$2
&stp=1"
;;
url
=
"
${
url
}
/api/#stq=
$2
&stp=1"
;;
"stackoverflow"
)
url
=
"
${
url
}
https://stackoverflow.com"
url
=
"
${
url
}
/search?q=
$2
"
;;
*
)
echo
"INVALID PARAM!"
*
)
echo
"INVALID PARAM!"
return
;;
return
;;
esac
esac
...
@@ -149,3 +153,6 @@ alias smacss='frontend smacss'
...
@@ -149,3 +153,6 @@ alias smacss='frontend smacss'
alias
angularjs
=
'frontend angularjs'
alias
angularjs
=
'frontend angularjs'
alias
reactjs
=
'frontend reactjs'
alias
reactjs
=
'frontend reactjs'
alias
emberjs
=
'frontend emberjs'
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