diff options
author | Will Mendes <willmendesneto@gmail.com> | 2015-04-18 20:59:13 -0300 |
---|---|---|
committer | Will Mendes <willmendesneto@gmail.com> | 2015-04-18 20:59:13 -0300 |
commit | eea77b7cb7a8d64a03d7eddc5e0f05e122b82546 (patch) | |
tree | 0084cd8c1ad23cfe450cc96fce34bf35e8a32781 /plugins | |
parent | 75b9030f48a55a42849cc68b0fc5b92d66d236ac (diff) | |
download | zsh-eea77b7cb7a8d64a03d7eddc5e0f05e122b82546.tar.gz zsh-eea77b7cb7a8d64a03d7eddc5e0f05e122b82546.tar.bz2 zsh-eea77b7cb7a8d64a03d7eddc5e0f05e122b82546.zip |
Add stackoverflow link
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/frontend-search/README.md | 2 | ||||
-rw-r--r-- | plugins/frontend-search/frontend-search.plugin.zsh | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/plugins/frontend-search/README.md b/plugins/frontend-search/README.md index 32784d03b..c1ccc9092 100644 --- a/plugins/frontend-search/README.md +++ b/plugins/frontend-search/README.md @@ -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 diff --git a/plugins/frontend-search/frontend-search.plugin.zsh b/plugins/frontend-search/frontend-search.plugin.zsh index f1d45b0d1..c9e51b2e0 100644 --- a/plugins/frontend-search/frontend-search.plugin.zsh +++ b/plugins/frontend-search/frontend-search.plugin.zsh @@ -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' |