Unverified Commit cad48e38 authored by Marc Cornellà's avatar Marc Cornellà Committed by GitHub
Browse files

Merge branch 'master' into fabric_task_description

parents 225425fe 40df67bc
# Fabric
This plugin provides completion for [Fabric](https://www.fabfile.org/).
To use it add fabric to the plugins array in your zshrc file.
```bash
plugins=(... fabric)
```
# DECLARION: This plugin was created by vhbit. What I did is just making a portal from https://github.com/vhbit/fabric-zsh-autocomplete.
# Use Ctrl-Z to switch back to Vim # Use Ctrl-Z to switch back to Vim
I frequently need to execute random command in my shell. To achieve it I pause I frequently need to execute random commands in my shell. To achieve it I pause
Vim by pressing Ctrl-z, type command and press fg<Enter> to switch back to Vim. Vim by pressing Ctrl-z, type command and press fg<Enter> to switch back to Vim.
The fg part really hurt sme. I just wanted to hit Ctrl-z once again to get back The fg part really hurts me. I just wanted to hit Ctrl-z once again to get back
to Vim. I could not find a solution, so I developed one on my own that to Vim. I could not find a solution, so I developed one on my own that
works wonderfully with ZSH works wonderfully with ZSH.
Source: http://sheerun.net/2014/03/21/how-to-boost-your-vim-productivity/ Source: http://sheerun.net/2014/03/21/how-to-boost-your-vim-productivity/
......
...@@ -6,6 +6,7 @@ if [ $commands[fasd] ]; then # check if fasd is installed ...@@ -6,6 +6,7 @@ if [ $commands[fasd] ]; then # check if fasd is installed
source "$fasd_cache" source "$fasd_cache"
unset fasd_cache unset fasd_cache
alias v="f -e $EDITOR" alias v='f -e "$EDITOR"'
alias o='a -e open_command' alias o='a -e xdg-open'
alias j='zz'
fi fi
# fbterm
This plugin automatically starts [fbterm](https://github.com/zhangyuanwei/fbterm)
if on a real TTY (`/dev/tty*`).
To use it, add fbterm to the plugins array of your zshrc file:
```
plugins=(... fbterm)
```
# fd
This plugin adds completion for the file search tool [`fd`](https://github.com/sharkdp/fd), also known as `fd-find`.
To use it, add `fd` to the plugins array in your zshrc file:
```zsh
plugins=(... fd)
```
Completion is taken from the fd release [`7.3.0`](https://github.com/sharkdp/fd/releases/tag/v7.3.0).
Updated on Febrary 13th, 2019.
#compdef fd fdfind
autoload -U is-at-least
_fd() {
typeset -A opt_args
typeset -a _arguments_options
local ret=1
if is-at-least 5.2; then
_arguments_options=(-s -S -C)
else
_arguments_options=(-s -C)
fi
local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" \
'-d+[Set maximum search depth (default: none)]' \
'--max-depth=[Set maximum search depth (default: none)]' \
'--maxdepth=[See --max-depth]' \
'*-t+[Filter by type: file (f), directory (d), symlink (l),
executable (x), empty (e)]: :(f file d directory l symlink x executable e empty)' \
'*--type=[Filter by type: file (f), directory (d), symlink (l),
executable (x), empty (e)]: :(f file d directory l symlink x executable e empty)' \
'*-e+[Filter by file extension]' \
'*--extension=[Filter by file extension]' \
'-x+[Execute a command for each search result]' \
'--exec=[Execute a command for each search result]' \
'(-x --exec)-X+[Execute a command with all search results at once]' \
'(-x --exec)--exec-batch=[Execute a command with all search results at once]' \
'*-E+[Exclude entries that match the given glob pattern]' \
'*--exclude=[Exclude entries that match the given glob pattern]' \
'*--ignore-file=[Add a custom ignore-file in .gitignore format]' \
'-c+[When to use colors: never, *auto*, always]: :(never auto always)' \
'--color=[When to use colors: never, *auto*, always]: :(never auto always)' \
'-j+[Set number of threads to use for searching & executing]' \
'--threads=[Set number of threads to use for searching & executing]' \
'*-S+[Limit results based on the size of files.]' \
'*--size=[Limit results based on the size of files.]' \
'--max-buffer-time=[the time (in ms) to buffer, before streaming to the console]' \
'--changed-within=[Filter by file modification time (newer than)]' \
'--changed-before=[Filter by file modification time (older than)]' \
'*--search-path=[(hidden)]' \
'-H[Search hidden files and directories]' \
'--hidden[Search hidden files and directories]' \
'-I[Do not respect .(git|fd)ignore files]' \
'--no-ignore[Do not respect .(git|fd)ignore files]' \
'--no-ignore-vcs[Do not respect .gitignore files]' \
'*-u[Alias for no-ignore and/or hidden]' \
'-s[Case-sensitive search (default: smart case)]' \
'--case-sensitive[Case-sensitive search (default: smart case)]' \
'-i[Case-insensitive search (default: smart case)]' \
'--ignore-case[Case-insensitive search (default: smart case)]' \
'-F[Treat the pattern as a literal string]' \
'--fixed-strings[Treat the pattern as a literal string]' \
'-a[Show absolute instead of relative paths]' \
'--absolute-path[Show absolute instead of relative paths]' \
'-L[Follow symbolic links]' \
'--follow[Follow symbolic links]' \
'-p[Search full path (default: file-/dirname only)]' \
'--full-path[Search full path (default: file-/dirname only)]' \
'-0[Separate results by the null character]' \
'--print0[Separate results by the null character]' \
'--show-errors[Enable display of filesystem errors]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'::pattern -- the search pattern, a regular expression (optional):_files' \
'::path -- the root directory for the filesystem search (optional):_files' \
&& ret=0
}
(( $+functions[_fd_commands] )) ||
_fd_commands() {
local commands; commands=(
)
_describe -t commands 'fd commands' commands "$@"
}
_fd "$@"
This is a plugin based on yum plugin, but using dnf as main frontend The fedora plugin is deprecated. Use the [dnf plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/dnf) instead.
(from Fedora 22 onwards, yum is deprecated in favor of dnf).
## Aliases
alias dnfs="dnf search" # search package
alias dnfp="dnf info" # show package info
alias dnfl="dnf list" # list packages
alias dnfgl="dnf grouplist" # list package groups
alias dnfli="dnf list installed" # print all installed packages
alias dnfmc="dnf makecache" # rebuilds the dnf package list
alias dnfu="sudo dnf upgrade" # upgrade packages
alias dnfi="sudo dnf install" # install package
alias dnfgi="sudo dnf groupinstall" # install package group
alias dnfr="sudo dnf remove" # remove package
alias dnfgr="sudo dnf groupremove" # remove pagage group
alias dnfrl="sudo dnf remove --remove-leaves" # remove package and leaves
alias dnfc="sudo dnf clean all" # clean cache
../dnf/dnf.plugin.zsh
\ No newline at end of file
...@@ -6,7 +6,7 @@ alias fwrp="sudo firewall-cmd --runtime-to-permanent" ...@@ -6,7 +6,7 @@ alias fwrp="sudo firewall-cmd --runtime-to-permanent"
function fwl () { function fwl () {
# converts output to zsh array () # converts output to zsh array ()
# @f flag split on new line # @f flag split on new line
zones=("${(@f)$(sudo firewall-cmd --get-active-zones | grep -v interfaces)}") zones=("${(@f)$(sudo firewall-cmd --get-active-zones | grep -v 'interfaces\|sources')}")
for i in $zones; do for i in $zones; do
sudo firewall-cmd --zone $i --list-all sudo firewall-cmd --zone $i --list-all
......
## Flutter plugin
The Flutter plugin provides completion and useful aliases
To use it, add flutter to the plugins array of your zshrc file:
```
plugins=(... flutter)
```
## Aliases
| Alias | Command | Description |
| :--------- | :--------------------- | :------------------------------------------------------------------------- |
| `fl` | `flutter` | Shorthand for flutter command |
| `flr` | `flutter run` | Runs flutter app |
| `fldoc` | `flutter doctor` | Runs flutter doctor |
| `flb` | `flutter build` | Build flutter application |
| `flattach` | `flutter attach` | Attaches flutter to a running flutter application with enabled observatory |
| `flget` | `flutter packages get` | Installs dependencies |
| `flc` | `flutter clean` | Cleans flutter porject |
#compdef flutter
#autoload
local -a _1st_arguments
_1st_arguments=(
"analyze":"Analyze the project's Dart code."
"assemble":"Assemble and build flutter resources."
"attach":"Attach to a running application."
"build":"Flutter build commands."
"channel":"List or switch flutter channels."
"clean":"Delete the build/ and .dart_tool/ directories."
"config":"Configure Flutter settings."
"create":"Create a new Flutter project."
"devices":"List all connected devices."
"doctor":"Show information about the installed tooling."
"drive":"Runs Flutter Driver tests for the current project."
"emulators":"List, launch and create emulators."
"format":" Format one or more dart files."
"help":"Display help information for flutter."
"install":"Install a Flutter app on an attached device."
"logs":"Show log output for running Flutter apps."
"make-host-app-editable":"Moves host apps from generated directories to non-generated directories so that they can be edited by developers."
"precache":"Populates the Flutter tool's cache of binary artifacts."
"pub":"Commands for managing Flutter packages."
"run":"Run your Flutter app on an attached device."
"screenshot":"Take a screenshot from a connected device."
"test":"Run Flutter unit tests for the current project."
"upgrade":"Upgrade your copy of Flutter."
"version":"List or switch flutter versions."
)
_arguments -C '*:: :->subcmds'
if (( CURRENT == 1 )); then
_describe -t commands "flutter command" _1st_arguments
return
fi
alias fl="flutter"
alias flr="flutter run"
alias fldoc="flutter doctor"
alias flb="flutter build"
alias flattach="flutter attach"
alias flget="flutter packages get"
alias flc="flutter clean"
...@@ -4,7 +4,7 @@ Plugin for ForkLift, an FTP application for OS X. ...@@ -4,7 +4,7 @@ Plugin for ForkLift, an FTP application for OS X.
### Requirements ### Requirements
* [ForkLift](http://www.binarynights.com/forklift/) * [ForkLift](https://binarynights.com/)
### Usage ### Usage
......
# Open folder in ForkLift.app or ForkLift2.app from console # Open folder in ForkLift.app or ForkLift2.app from console
# Author: Adam Strzelecki nanoant.com, modified by Bodo Tasche bitboxer.de # Author: Adam Strzelecki nanoant.com, modified by Bodo Tasche bitboxer.de
# Updated to support ForkLift2 by Johan Kaving # Updated to support ForkLift 2 and ForkLift 3 by Johan Kaving
# #
# Usage: # Usage:
# fl [<folder>] # fl [<folder>]
...@@ -24,46 +24,84 @@ function fl { ...@@ -24,46 +24,84 @@ function fl {
fi fi
osascript 2>&1 1>/dev/null <<END osascript 2>&1 1>/dev/null <<END
try try
tell application "Finder" tell application "Finder"
set appName to name of application file id "com.binarynights.ForkLift2" set forkLift3 to name of application file id "com.binarynights.ForkLift-3"
end tell end tell
on error err_msg number err_num on error err_msg number err_num
tell application "Finder" set forkLift3 to null
set appName to name of application file id "com.binarynights.ForkLift" end try
end tell try
end try tell application "Finder"
set forkLift2 to name of application file id "com.binarynights.ForkLift2"
end tell
on error err_msg number err_num
set forkLift2 to null
end try
try
tell application "Finder"
set forkLift to name of application file id "com.binarynights.ForkLift"
end tell
on error err_msg number err_num
set forkLift to null
end try
if application appName is running if forkLift3 is not null and application forkLift3 is running then
tell application appName tell application forkLift3
activate activate
end tell set forkLiftVersion to version
else end tell
tell application appName else if forkLift2 is not null and application forkLift2 is running then
tell application forkLift2
activate activate
end tell set forkLiftVersion to version
repeat until application appName is running end tell
delay 1 else if forkLift is not null and application forkLift is running then
end repeat tell application forkLift
tell application appName
activate activate
end tell set forkLiftVersion to version
end tell
else
if forkLift3 is not null then
set appName to forkLift3
else if forkLift2 is not null then
set appName to forkLift2
else if forkLift is not null then
set appName to forkLift
end if end if
tell application appName
activate
set forkLiftVersion to version
end tell
repeat until application appName is running
delay 1
end repeat
tell application appName
activate
end tell
end if
tell application "System Events" tell application "System Events"
tell application process "ForkLift" tell application process "ForkLift"
try try
set topWindow to window 1 set topWindow to window 1
on error on error
keystroke "n" using command down keystroke "n" using command down
set topWindow to window 1 set topWindow to window 1
end try end try
keystroke "g" using {command down, shift down} keystroke "g" using {command down, shift down}
tell sheet 1 of topWindow if forkLiftVersion starts with "3" then
set value of text field 1 to "$PWD" tell pop over of list of group of splitter group of splitter group of topWindow
keystroke return set value of text field 1 to "$PWD"
end tell end tell
end tell else
tell sheet 1 of topWindow
set value of text field 1 to "$PWD"
end tell
end if
keystroke return
end tell end tell
end tell
END END
} }
## Introduction ## ## Introduction
> Searches for your frontend web development made easier > Searches for your frontend web development made easier
## Installation
## Installation ##
Open your `~/.zshrc` file and enable the `frontend-search` plugin: Open your `~/.zshrc` file and enable the `frontend-search` plugin:
...@@ -13,53 +12,63 @@ plugins=( ... frontend-search) ...@@ -13,53 +12,63 @@ plugins=( ... frontend-search)
``` ```
## Usage
## Usage ##
You can use the frontend-search plugin in these two forms: You can use the frontend-search plugin in these two forms:
* `frontend <context> <term> [more terms if you want]` - `frontend <context> <term> [more terms if you want]`
* `<context> <term> [more terms if you want]` - `<context> <term> [more terms if you want]`
For example, these two are equivalent: For example, these two are equivalent:
```zsh ```zsh
$ frontend angularjs dependency injection $ angular dependency injection
$ angularjs dependency injection # Will turn into ...
$ frontend angular dependency injection
``` ```
Available search contexts are: Available search contexts are:
| context | URL | | context | URL |
|---------------|--------------------------------------------------------------------------| | ------------- | --------------------------------------------------------------------------- |
| angularjs | `https://google.com/search?as_sitesearch=angularjs.org&as_q=` | | angular | `https://angular.io/?search=` |
| aurajs | `http://aurajs.com/api/#stq=` | | angularjs | `https://google.com/search?as_sitesearch=angularjs.org&as_q=` |
| bem | `https://google.com/search?as_sitesearch=bem.info&as_q=` | | bem | `https://google.com/search?as_sitesearch=bem.info&as_q=` |
| bootsnipp | `http://bootsnipp.com/search?q=` | | bootsnipp | `https://bootsnipp.com/search?q=` |
| caniuse | `http://caniuse.com/#search=` | | bundlephobia | `https://bundlephobia.com/result?p=` |
| codepen | `http://codepen.io/search?q=` | | caniuse | `https://caniuse.com/#search=` |
| compassdoc | `http://compass-style.org/search?q=` | | codepen | `https://codepen.io/search?q=` |
| cssflow | `http://www.cssflow.com/search?q=` | | compassdoc | `http://compass-style.org/search?q=` |
| dartlang | `https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:` | | cssflow | `http://www.cssflow.com/search?q=` |
| emberjs | `http://emberjs.com/api/#stp=1&stq=` | | dartlang | `https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:` |
| fontello | `http://fontello.com/#search=` | | emberjs | `https://www.google.com/search?as_sitesearch=emberjs.com/&as_q=` |
| html5please | `http://html5please.com/#` | | flowtype | `https://google.com/search?as_sitesearch=flow.org/en/docs/&as_q=` |
| jquery | `https://api.jquery.com/?s=` | | fontello | `http://fontello.com/#search=` |
| lodash | `https://devdocs.io/lodash/index#` | | github | `https://github.com/search?q=` |
| mdn | `https://developer.mozilla.org/search?q=` | | html5please | `https://html5please.com/#` |
| npmjs | `https://www.npmjs.com/search?q=` | | jestjs | `https://www.google.com/search?as_sitesearch=jestjs.io&as_q=` |
| qunit | `https://api.qunitjs.com/?s=` | | jquery | `https://api.jquery.com/?s=` |
| reactjs | `https://google.com/search?as_sitesearch=facebook.github.io/react&as_q=` | | lodash | `https://devdocs.io/lodash/index#` |
| smacss | `https://google.com/search?as_sitesearch=smacss.com&as_q=` | | mdn | `https://developer.mozilla.org/search?q=` |
| stackoverflow | `http://stackoverflow.com/search?q=` | | nodejs | `https://www.google.com/search?as_sitesearch=nodejs.org/en/docs/&as_q=` |
| unheap | `http://www.unheap.com/?s=` | | npmjs | `https://www.npmjs.com/search?q=` |
| qunit | `https://api.qunitjs.com/?s=` |
| reactjs | `https://google.com/search?as_sitesearch=facebook.github.io/react&as_q=` |
| smacss | `https://google.com/search?as_sitesearch=smacss.com&as_q=` |
| stackoverflow | `https://stackoverflow.com/search?q=` |
| typescript | `https://google.com/search?as_sitesearch=www.typescriptlang.org/docs&as_q=` |
| unheap | `http://www.unheap.com/?s=` |
| vuejs | `https://www.google.com/search?as_sitesearch=vuejs.org&as_q=` |
If you want to have another context, open an Issue and tell us! If you want to have another context, open an Issue and tell us!
## Fallback search behaviour
The plugin will use Google as a fallback if the docs site for a search context does not have a search function. You can set the fallback search engine to DuckDuckGo by setting `FRONTEND_SEARCH_FALLBACK='duckduckgo'` in your `~/.zshrc` file before Oh My Zsh is sourced.
## Author ## Author
**Wilson Mendes (willmendesneto)** **Wilson Mendes (willmendesneto)**
+ <https://plus.google.com/+WilsonMendes>
+ <https://twitter.com/willmendesneto> - <https://twitter.com/willmendesneto>
+ <http://github.com/willmendesneto> - <https://github.com/willmendesneto>
...@@ -17,27 +17,34 @@ function _frontend() { ...@@ -17,27 +17,34 @@ function _frontend() {
frontend_points=( "${(f)mapfile[$CONFIG]//$HOME/~}" ) frontend_points=( "${(f)mapfile[$CONFIG]//$HOME/~}" )
commands=( commands=(
'jquery: Search in jQuery website' 'angular: Search in Angular.io website'
'mdn: Search in MDN website' 'angularjs: Search in docs.angularjs.org website'
'compassdoc: Search in COMPASS website' 'bem: Search in BEM website'
'html5please: Search in HTML5 Please website' 'bootsnipp: Search in bootsnipp website'
'bundlephobia: Search in Bundlephobia website'
'caniuse: Search in Can I Use website' 'caniuse: Search in Can I Use website'
'aurajs: Search in AuraJs website' 'codepen: Search in codepen website'
'compassdoc: Search in COMPASS website'
'cssflow: Search in cssflow website'
'dartlang: Search in Dart website' 'dartlang: Search in Dart website'
'emberjs: Search in Ember website'
'flowtype: Search in Flowtype website'
'fontello: Search in fontello website'
'github: Search in GitHub website'
'html5please: Search in HTML5 Please website'
'jestjs: Search in Jest website'
'jquery: Search in jQuery website'
'lodash: Search in Lo-Dash website' 'lodash: Search in Lo-Dash website'
'mdn: Search in MDN website'
'nodejs: Search in NodeJS website'
'npmjs: Search in NPMJS website'
'qunit: Search in Qunit website' 'qunit: Search in Qunit website'
'fontello: Search in fontello website'
'bootsnipp: Search in bootsnipp website'
'cssflow: Search in cssflow website'
'codepen: Search in codepen website'
'unheap: Search in unheap website'
'bem: Search in BEM website'
'smacss: Search in SMACSS website'
'angularjs: Search in Angular website'
'reactjs: Search in React website' 'reactjs: Search in React website'
'emberjs: Search in Ember website' 'smacss: Search in SMACSS website'
'stackoverflow: Search in StackOverflow website' 'stackoverflow: Search in StackOverflow website'
'npmjs: Search in NPMJS website' 'typescript: Search in TypeScript website'
'unheap: Search in unheap website'
'vuejs: Search in VueJS website'
) )
_arguments -C \ _arguments -C \
...@@ -66,9 +73,6 @@ function _frontend() { ...@@ -66,9 +73,6 @@ function _frontend() {
caniuse) caniuse)
_describe -t points "Warp points" frontend_points && ret=0 _describe -t points "Warp points" frontend_points && ret=0
;; ;;
aurajs)
_describe -t points "Warp points" frontend_points && ret=0
;;
dartlang) dartlang)
_describe -t points "Warp points" frontend_points && ret=0 _describe -t points "Warp points" frontend_points && ret=0
;; ;;
...@@ -81,6 +85,9 @@ function _frontend() { ...@@ -81,6 +85,9 @@ function _frontend() {
fontello) fontello)
_describe -t points "Warp points" frontend_points && ret=0 _describe -t points "Warp points" frontend_points && ret=0
;; ;;
github)
_describe -t points "Warp points" frontend_points && ret=0
;;
bootsnipp) bootsnipp)
_describe -t points "Warp points" frontend_points && ret=0 _describe -t points "Warp points" frontend_points && ret=0
;; ;;
...@@ -114,6 +121,24 @@ function _frontend() { ...@@ -114,6 +121,24 @@ function _frontend() {
npmjs) npmjs)
_describe -t points "Warp points" frontend_points && ret=0 _describe -t points "Warp points" frontend_points && ret=0
;; ;;
bundlephobia)
_describe -t points "Warp points" frontend_points && ret=0
;;
flowtype)
_describe -t points "Warp points" frontend_points && ret=0
;;
typescript)
_describe -t points "Warp points" frontend_points && ret=0
;;
vuejs)
_describe -t points "Warp points" frontend_points && ret=0
;;
nodejs)
_describe -t points "Warp points" frontend_points && ret=0
;;
jestjs)
_describe -t points "Warp points" frontend_points && ret=0
;;
esac esac
;; ;;
esac esac
......
alias angular='frontend angular'
alias angularjs='frontend angularjs' alias angularjs='frontend angularjs'
alias aurajs='frontend aurajs'
alias bem='frontend bem' alias bem='frontend bem'
alias bootsnipp='frontend bootsnipp' alias bootsnipp='frontend bootsnipp'
alias bundlephobia='frontend bundlephobia'
alias caniuse='frontend caniuse' alias caniuse='frontend caniuse'
alias codepen='frontend codepen' alias codepen='frontend codepen'
alias compassdoc='frontend compassdoc' alias compassdoc='frontend compassdoc'
alias cssflow='frontend cssflow' alias cssflow='frontend cssflow'
alias dartlang='frontend dartlang' alias dartlang='frontend dartlang'
alias emberjs='frontend emberjs' alias emberjs='frontend emberjs'
alias flowtype='frontend flowtype'
alias fontello='frontend fontello' alias fontello='frontend fontello'
alias github='frontend github'
alias html5please='frontend html5please' alias html5please='frontend html5please'
alias jestjs='frontend jestjs'
alias jquery='frontend jquery' alias jquery='frontend jquery'
alias lodash='frontend lodash' alias lodash='frontend lodash'
alias mdn='frontend mdn' alias mdn='frontend mdn'
alias nodejs='frontend nodejs'
alias npmjs='frontend npmjs' alias npmjs='frontend npmjs'
alias qunit='frontend qunit' alias qunit='frontend qunit'
alias reactjs='frontend reactjs' alias reactjs='frontend reactjs'
alias smacss='frontend smacss' alias smacss='frontend smacss'
alias stackoverflow='frontend stackoverflow' alias stackoverflow='frontend stackoverflow'
alias typescript='frontend typescript'
alias unheap='frontend unheap' alias unheap='frontend unheap'
alias vuejs='frontend vuejs'
function _frontend_fallback() {
local url
if [[ "$FRONTEND_SEARCH_FALLBACK" == duckduckgo ]]; then
url="https://duckduckgo.com/?sites=$1&q="
else
url="https://google.com/search?as_sitesearch=$1&as_q="
fi
echo "$url"
}
function frontend() { function frontend() {
emulate -L zsh emulate -L zsh
...@@ -26,27 +44,34 @@ function frontend() { ...@@ -26,27 +44,34 @@ function frontend() {
# define search context URLS # define search context URLS
typeset -A urls typeset -A urls
urls=( urls=(
angularjs 'https://google.com/search?as_sitesearch=angularjs.org&as_q=' angular 'https://angular.io/?search='
aurajs 'http://aurajs.com/api/#stq=' angularjs $(_frontend_fallback 'angularjs.org')
bem 'https://google.com/search?as_sitesearch=bem.info&as_q=' bem $(_frontend_fallback 'bem.info')
bootsnipp 'http://bootsnipp.com/search?q=' bootsnipp 'https://bootsnipp.com/search?q='
caniuse 'http://caniuse.com/#search=' bundlephobia 'https://bundlephobia.com/result?p='
codepen 'http://codepen.io/search?q=' caniuse 'https://caniuse.com/#search='
codepen 'https://codepen.io/search?q='
compassdoc 'http://compass-style.org/search?q=' compassdoc 'http://compass-style.org/search?q='
cssflow 'http://www.cssflow.com/search?q=' cssflow 'http://www.cssflow.com/search?q='
dartlang 'https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:' dartlang 'https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:'
emberjs 'http://emberjs.com/api/#stp=1&stq=' emberjs $(_frontend_fallback 'emberjs.com/')
flowtype $(_frontend_fallback 'flow.org/en/docs/')
fontello 'http://fontello.com/#search=' fontello 'http://fontello.com/#search='
html5please 'http://html5please.com/#' github 'https://github.com/search?q='
html5please 'https://html5please.com/#'
jestjs $(_frontend_fallback 'jestjs.io')
jquery 'https://api.jquery.com/?s=' jquery 'https://api.jquery.com/?s='
lodash 'https://devdocs.io/lodash/index#' lodash 'https://devdocs.io/lodash/index#'
mdn 'https://developer.mozilla.org/search?q=' mdn 'https://developer.mozilla.org/search?q='
nodejs $(_frontend_fallback 'nodejs.org/en/docs/')
npmjs 'https://www.npmjs.com/search?q=' npmjs 'https://www.npmjs.com/search?q='
qunit 'https://api.qunitjs.com/?s=' qunit 'https://api.qunitjs.com/?s='
reactjs 'https://google.com/search?as_sitesearch=facebook.github.io/react&as_q=' reactjs $(_frontend_fallback 'reactjs.org/')
smacss 'https://google.com/search?as_sitesearch=smacss.com&as_q=' smacss $(_frontend_fallback 'smacss.com')
stackoverflow 'http://stackoverflow.com/search?q=' stackoverflow 'https://stackoverflow.com/search?q='
typescript $(_frontend_fallback 'www.typescriptlang.org/docs')
unheap 'http://www.unheap.com/?s=' unheap 'http://www.unheap.com/?s='
vuejs $(_frontend_fallback 'vuejs.org')
) )
# show help for command list # show help for command list
...@@ -57,9 +82,9 @@ function frontend() { ...@@ -57,9 +82,9 @@ function frontend() {
print -P "%Uterm%u and what follows is what will be searched for in the %Ucontext%u website," 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 "and %Ucontext%u is one of the following:"
print -P "" print -P ""
print -P " angularjs, aurajs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow," print -P " angular, angularjs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow,"
print -P " dartlang, emberjs, fontello, html5please, jquery, lodash, mdn, npmjs," print -P " dartlang, emberjs, fontello, flowtype, github, html5please, jestjs, jquery, lodash,"
print -P " qunit, reactjs, smacss, stackoverflow, unheap" print -P " mdn, npmjs, nodejs, qunit, reactjs, smacss, stackoverflow, unheap, vuejs, bundlephobia"
print -P "" print -P ""
print -P "For example: frontend npmjs mocha (or just: npmjs mocha)." print -P "For example: frontend npmjs mocha (or just: npmjs mocha)."
print -P "" print -P ""
...@@ -73,17 +98,17 @@ function frontend() { ...@@ -73,17 +98,17 @@ function frontend() {
echo "" echo ""
echo "Valid contexts are:" echo "Valid contexts are:"
echo "" echo ""
echo " angularjs, aurajs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow, " echo " angular, angularjs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow,"
echo " dartlang, emberjs, fontello, html5please, jquery, lodash, mdn, npmjs, " echo " dartlang, emberjs, fontello, github, html5please, jest, jquery, lodash,"
echo " qunit, reactjs, smacss, stackoverflow, unheap" echo " mdn, npmjs, nodejs, qunit, reactjs, smacss, stackoverflow, unheap, vuejs, bundlephobia"
echo "" echo ""
return 1 return 1
fi fi
# build search url: # build search url:
# join arguments passed with '+', then append to search context URL # join arguments passed with '%20', then append to search context URL
# TODO substitute for proper urlencode method # TODO substitute for proper urlencode method
url="${urls[$1]}${(j:+:)@[2,-1]}" url="${urls[$1]}${(j:%20:)@[2,-1]}"
echo "Opening $url ..." echo "Opening $url ..."
......
# fzf
This plugin enables [junegunn's fzf](https://github.com/junegunn/fzf) fuzzy auto-completion and key bindings
```zsh
# Set fzf installation directory path
export FZF_BASE=/path/to/fzf/install/dir
# Uncomment the following line to disable fuzzy completion
# export DISABLE_FZF_AUTO_COMPLETION="true"
# Uncomment the following line to disable key bindings (CTRL-T, CTRL-R, ALT-C)
# export DISABLE_FZF_KEY_BINDINGS="true"
plugins=(
...
fzf
)
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment