summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/brew/brew.plugin.zsh1
-rw-r--r--plugins/bundler/README.md49
-rw-r--r--plugins/bundler/_bundler13
-rw-r--r--plugins/bundler/bundler.plugin.zsh53
-rw-r--r--plugins/docker/_docker2
-rw-r--r--plugins/frontend-search/README.md82
-rw-r--r--plugins/frontend-search/frontend-search.plugin.zsh151
-rw-r--r--plugins/jira/jira.plugin.zsh12
-rw-r--r--plugins/mvn/mvn.plugin.zsh2
-rw-r--r--plugins/osx/osx.plugin.zsh5
-rw-r--r--plugins/postgres/postgres.plugin.zsh8
-rw-r--r--plugins/rvm/rvm.plugin.zsh12
-rwxr-xr-xplugins/wd/wd.sh2
13 files changed, 378 insertions, 14 deletions
diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh
index c2e95884e..f9497aefb 100644
--- a/plugins/brew/brew.plugin.zsh
+++ b/plugins/brew/brew.plugin.zsh
@@ -1 +1,2 @@
alias brews='brew list -1'
+alias bubu="brew update && brew upgrade"
diff --git a/plugins/bundler/README.md b/plugins/bundler/README.md
new file mode 100644
index 000000000..56f0c7176
--- /dev/null
+++ b/plugins/bundler/README.md
@@ -0,0 +1,49 @@
+# Bundler
+
+- adds completion for basic bundler commands
+- adds short aliases for common bundler commands
+ - `be` aliased to `bundle exec`
+ - `bl` aliased to `bundle list`
+ - `bp` aliased to `bundle package`
+ - `bo` aliased to `bundle open`
+ - `bu` aliased to `bundle update`
+ - `bi` aliased to `bundle install --jobs=<cpu core count>` (only for bundler `>= 1.4.0`)
+- adds a wrapper for common gems:
+ - looks for a binstub under `./bin/` and executes it (if present)
+ - calls `bundle exec <gem executable>` otherwise
+
+For a full list of *common gems* being wrapped by default please look at the `bundler.plugin.zsh` file.
+
+## Configuration
+
+Please use the exact name of the executable and not the gem name.
+
+### Add additional gems to be wrapped
+
+Add this before the plugin-list in your `.zshrc`:
+```sh
+BUNDLED_COMMANDS=(rubocop)
+plugins=(... bundler ...)
+```
+This will add the wrapper for the `rubocop` gem (i.e. the executable).
+
+
+### Exclude gems from being wrapped
+
+Add this before the plugin-list in your `.zshrc`:
+```sh
+UNBUNDLED_COMMANDS=(foreman spin)
+plugins=(... bundler ...)
+```
+This will exclude the `foreman` and `spin` gems (i.e. their executable) from being wrapped.
+
+## Excluded gems
+
+These gems should not be called with `bundle exec`. Please see the Issues on GitHub for clarification.
+
+`berks`
+`foreman`
+`mailcatcher`
+`rails`
+`ruby`
+`spin`
diff --git a/plugins/bundler/_bundler b/plugins/bundler/_bundler
index 2ec3a5f9c..ba647ab80 100644
--- a/plugins/bundler/_bundler
+++ b/plugins/bundler/_bundler
@@ -18,11 +18,13 @@ case $state in
"check[Determine whether the requirements for your application are installed]" \
"list[Show all of the gems in the current bundle]" \
"show[Show the source location of a particular gem in the bundle]" \
+ "outdated[Show all of the outdated gems in the current bundle]" \
"console[Start an IRB session in the context of the current bundle]" \
"open[Open an installed gem in the editor]" \
"viz[Generate a visual representation of your dependencies]" \
"init[Generate a simple Gemfile, placed in the current directory]" \
"gem[Create a simple gem, suitable for development with bundler]" \
+ "platform[Displays platform compatibility information]" \
"clean[Cleans up unused gems in your bundler directory]" \
"help[Describe available tasks or one specific task]"
ret=0
@@ -39,11 +41,13 @@ case $state in
'check' \
'list' \
'show' \
+ 'outdated' \
'console' \
'open' \
'viz' \
'init' \
'gem' \
+ 'platform' \
'help' && ret=0
;;
install)
@@ -71,6 +75,15 @@ case $state in
'(--verbose)--verbose[Enable verbose output mode]'
ret=0
;;
+ outdated)
+ _arguments \
+ '(--pre)--pre[Check for newer pre-release gems]' \
+ '(--source)--source[Check against a specific source]' \
+ '(--local)--local[Do not attempt to fetch gems remotely and use the gem cache instead]' \
+ '(--no-color)--no-color[Disable colorization in output]' \
+ '(--verbose)--verbose[Enable verbose output mode]'
+ ret=0
+ ;;
(open|show)
_gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') )
if [[ $_gems != "" ]]; then
diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
index 20931dcef..617dcde71 100644
--- a/plugins/bundler/bundler.plugin.zsh
+++ b/plugins/bundler/bundler.plugin.zsh
@@ -5,15 +5,49 @@ alias bo="bundle open"
alias bu="bundle update"
alias bi="bundle_install"
-# The following is based on https://github.com/gma/bundler-exec
-
-bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard irb jekyll kitchen knife middleman nanoc puma rackup rainbows rake rspec ruby shotgun spec spin spork spring strainer tailor taps thin thor unicorn unicorn_rails)
+bundled_commands=(
+ annotate
+ cap
+ capify
+ cucumber
+ foodcritic
+ guard
+ irb
+ jekyll
+ kitchen
+ knife
+ middleman
+ nanoc
+ pry
+ puma
+ rackup
+ rainbows
+ rake
+ rspec
+ shotgun
+ sidekiq
+ spec
+ spork
+ spring
+ strainer
+ tailor
+ taps
+ thin
+ thor
+ unicorn
+ unicorn_rails
+)
# Remove $UNBUNDLED_COMMANDS from the bundled_commands list
for cmd in $UNBUNDLED_COMMANDS; do
bundled_commands=(${bundled_commands#$cmd});
done
+# Add $BUNDLED_COMMANDS to the bundled_commands list
+for cmd in $BUNDLED_COMMANDS; do
+ bundled_commands+=($cmd);
+done
+
## Functions
bundle_install() {
@@ -48,9 +82,17 @@ _within-bundled-project() {
false
}
+_binstubbed() {
+ [ -f "./bin/${1}" ]
+}
+
_run-with-bundler() {
if _bundler-installed && _within-bundled-project; then
- bundle exec $@
+ if _binstubbed $1; then
+ ./bin/$@
+ else
+ bundle exec $@
+ fi
else
$@
fi
@@ -63,7 +105,6 @@ for cmd in $bundled_commands; do
alias $cmd=bundled_$cmd
if which _$cmd > /dev/null 2>&1; then
- compdef _$cmd bundled_$cmd=$cmd
+ compdef _$cmd bundled_$cmd=$cmd
fi
done
-
diff --git a/plugins/docker/_docker b/plugins/docker/_docker
index c291037a3..28568a6e5 100644
--- a/plugins/docker/_docker
+++ b/plugins/docker/_docker
@@ -214,7 +214,7 @@ __save() {
__start() {
_arguments \
'(-a,--attach=)'{-a,--attach=}'[Attach container''s stdout/stderr and forward all signals to the process]' \
- '(-i,--interactive=)'{-i, --interactive=}'[Attach container''s stdin]'
+ '(-i,--interactive=)'{-i,--interactive=}'[Attach container''s stdin]'
__docker_containers
}
diff --git a/plugins/frontend-search/README.md b/plugins/frontend-search/README.md
new file mode 100644
index 000000000..32784d03b
--- /dev/null
+++ b/plugins/frontend-search/README.md
@@ -0,0 +1,82 @@
+## Rationale ##
+
+The idea for this script is to help searches in important doc contents from frontend.
+
+## Instalation ##
+
+I will send a Pull Request with this plugin for .oh-my-zsh official repository. If accept them, it's only add in plugins list that exists in ```.zshrc``` file.
+
+For now, you can clone this repository and add in ```custom/plugins``` folder
+
+```bash
+$ git clone git://github.com/willmendesneto/frontend-search.git ~/.oh-my-zsh/custom/plugins/frontend-search
+```
+
+After this, restart your terminal and frontend-search plugin is configurated in you CLI.
+
+```bash
+...
+plugins=( <your-plugins-list>... frontend-search)
+...
+```
+
+## Commands ##
+
+All command searches are accept only in format
+
+* `frontend <search-content> <search-term>`
+
+The search content are
+
+* `jquery <api.jquery.com>`
+* `mdn <developer.mozilla.org>`
+* `compass <compass-style.org>`
+* `html5please <html5please.com>`
+* `caniuse <caniuse.com>`
+* `aurajs <aurajs.com>`
+* `dartlang <api.dartlang.org/apidocs/channels/stable/dartdoc-viewer>`
+* `lodash <search>`
+* `qunit <api.qunitjs.com>`
+* `fontello <fontello.com>`
+* `bootsnipp <bootsnipp.com>`
+* `cssflow <cssflow.com>`
+* `codepen <codepen.io>`
+* `unheap <www.unheap.com>`
+* `bem <google.com/search?as_q=<search-term>&as_sitesearch=bem.info>`
+* `smacss <google.com/search?as_q=<search-term>&as_sitesearch=smacss.com>`
+* `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>`
+
+
+## Aliases ##
+
+There are a few aliases presented as well:
+
+* `jquery` A shorthand for `frontend jquery`
+* `mdn` A shorthand for `frontend mdn`
+* `compass` A shorthand for `frontend compass`
+* `html5please` A shorthand for `frontend html5please`
+* `caniuse` A shorthand for `frontend caniuse`
+* `aurajs` A shorthand for `frontend aurajs`
+* `dartlang` A shorthand for `frontend dartlang`
+* `lodash` A shorthand for `frontend lodash`
+* `qunit` A shorthand for `frontend qunit`
+* `fontello` A shorthand for `frontend fontello`
+* `bootsnipp` A shorthand for `frontend bootsnipp`
+* `cssflow` A shorthand for `frontend cssflow`
+* `codepen` A shorthand for `frontend codepen`
+* `unheap` A shorthand for `frontend unheap`
+* `bem` A shorthand for `frontend bem`
+* `smacss` A shorthand for `frontend smacss`
+* `angularjs` A shorthand for `frontend angularjs`
+* `reactjs` A shorthand for `frontend reactjs`
+* `emberjs` A shorthand for `frontend emberjs`
+
+## Author
+
+**Wilson Mendes (willmendesneto)**
++ <https://twitter.com/willmendesneto>
++ <http://github.com/willmendesneto>
+
+New features comming soon.
diff --git a/plugins/frontend-search/frontend-search.plugin.zsh b/plugins/frontend-search/frontend-search.plugin.zsh
new file mode 100644
index 000000000..38b1a80ea
--- /dev/null
+++ b/plugins/frontend-search/frontend-search.plugin.zsh
@@ -0,0 +1,151 @@
+# frontend from terminal
+
+function frontend() {
+
+ # get the open command
+ local open_cmd
+ if [[ $(uname -s) == 'Darwin' ]]; then
+ open_cmd='open'
+ else
+ open_cmd='xdg-open'
+ fi
+
+ # no keyword provided, simply show how call methods
+ if [[ $# -le 1 ]]; then
+ echo "Please provide a search-content and a search-term for app.\nEx:\nfrontend <search-content> <search-term>\n"
+ return 1
+ 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)' ]];
+ then
+ echo "Search valid search content $1 not supported."
+ echo "Valid contents: (formats 'frontend <search-content>' or '<search-content>')"
+ echo "* jquery"
+ echo "* mdn"
+ echo "* compass"
+ echo "* html5please"
+ echo "* caniuse"
+ echo "* aurajs"
+ echo "* dartlang"
+ echo "* lodash"
+ echo "* qunit"
+ echo "* fontello"
+ echo "* bootsnipp"
+ echo "* cssflow"
+ echo "* codepen"
+ echo "* unheap"
+ echo "* bem"
+ echo "* smacss"
+ echo "* angularjs"
+ echo "* reactjs"
+ echo "* emberjs"
+ echo ""
+
+ return 1
+ fi
+
+ local url="http://"
+ local query=""
+
+ case "$1" in
+ "jquery")
+ url="${url}api.jquery.com"
+ url="${url}/?s=$2" ;;
+ "mdn")
+ url="${url}developer.mozilla.org"
+ url="${url}/search?q=$2" ;;
+ "compass")
+ url="${url}compass-style.org"
+ url="${url}/search?q=$2" ;;
+ "html5please")
+ url="${url}html5please.com"
+ url="${url}/#$2" ;;
+ "caniuse")
+ url="${url}caniuse.com"
+ url="${url}/#search=$2" ;;
+ "aurajs")
+ url="${url}aurajs.com"
+ url="${url}/api/#stq=$2" ;;
+ "dartlang")
+ url="${url}api.dartlang.org/apidocs/channels/stable/dartdoc-viewer"
+ url="${url}/dart-$2" ;;
+ "qunit")
+ url="${url}api.qunitjs.com"
+ url="${url}/?s=$2" ;;
+ "fontello")
+ url="${url}fontello.com"
+ url="${url}/#search=$2" ;;
+ "bootsnipp")
+ url="${url}bootsnipp.com"
+ url="${url}/search?q=$2" ;;
+ "cssflow")
+ url="${url}cssflow.com"
+ url="${url}/search?q=$2" ;;
+ "codepen")
+ url="${url}codepen.io"
+ url="${url}/search?q=$2" ;;
+ "unheap")
+ url="${url}www.unheap.com"
+ url="${url}/?s=$2" ;;
+ "bem")
+ url="${url}google.com"
+ url="${url}/search?as_q=$2&as_sitesearch=bem.info" ;;
+ "smacss")
+ url="${url}google.com"
+ url="${url}/search?as_q=$2&as_sitesearch=smacss.com" ;;
+ "angularjs")
+ url="${url}google.com"
+ url="${url}/search?as_q=$2&as_sitesearch=angularjs.org" ;;
+ "reactjs")
+ url="${url}google.com"
+ url="${url}/search?as_q=$2&as_sitesearch=facebook.github.io/react" ;;
+ "emberjs")
+ url="${url}emberjs.com"
+ url="${url}/api/#stq=$2&stp=1" ;;
+ *) echo "INVALID PARAM!"
+ return ;;
+ esac
+
+ echo "$url"
+
+ $open_cmd "$url"
+
+}
+
+# javascript
+alias jquery='frontend jquery'
+alias mdn='frontend mdn'
+
+# pre processors frameworks
+alias compass='frontend compass'
+
+# important links
+alias html5please='frontend html5please'
+alias caniuse='frontend caniuse'
+
+# components and libraries
+alias aurajs='frontend aurajs'
+alias dartlang='frontend dartlang'
+alias lodash='frontend lodash'
+
+#tests
+alias qunit='frontend qunit'
+
+#fonts
+alias fontello='frontend fontello'
+
+# snippets
+alias bootsnipp='frontend bootsnipp'
+alias cssflow='frontend cssflow'
+alias codepen='frontend codepen'
+alias unheap='frontend unheap'
+
+# css architecture
+alias bem='frontend bem'
+alias smacss='frontend smacss'
+
+# frameworks
+alias angularjs='frontend angularjs'
+alias reactjs='frontend reactjs'
+alias emberjs='frontend emberjs'
diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh
index 739ee7142..3d510e430 100644
--- a/plugins/jira/jira.plugin.zsh
+++ b/plugins/jira/jira.plugin.zsh
@@ -29,15 +29,23 @@ open_jira_issue () {
return 0
fi
+ if [ -f .jira-prefix ]; then
+ jira_prefix=$(cat .jira-prefix)
+ elif [ -f ~/.jira-prefix ]; then
+ jira_prefix=$(cat ~/.jira-prefix)
+ else
+ jira_prefix=""
+ fi
+
if [ -z "$1" ]; then
echo "Opening new issue"
$open_cmd "$jira_url/secure/CreateIssue!default.jspa"
else
echo "Opening issue #$1"
if [[ "x$JIRA_RAPID_BOARD" = "xtrue" ]]; then
- $open_cmd "$jira_url/issues/$1"
+ $open_cmd "$jira_url/issues/$jira_prefix$1"
else
- $open_cmd "$jira_url/browse/$1"
+ $open_cmd "$jira_url/browse/$jira_prefix$1"
fi
fi
}
diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh
index 2b7683078..a70625fcf 100644
--- a/plugins/mvn/mvn.plugin.zsh
+++ b/plugins/mvn/mvn.plugin.zsh
@@ -129,6 +129,8 @@ function listMavenCompletions {
tomcat6:run tomcat6:run-war tomcat6:run-war-only tomcat6:stop tomcat6:deploy tomcat6:undeploy
# tomcat7
tomcat7:run tomcat7:run-war tomcat7:run-war-only tomcat7:deploy
+ # spring-boot
+ spring-boot:run spring-boot:repackage
# exec
exec:exec exec:java
# versions
diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
index 63760b5ff..a63f0ee05 100644
--- a/plugins/osx/osx.plugin.zsh
+++ b/plugins/osx/osx.plugin.zsh
@@ -174,12 +174,16 @@ function itunes() {
next|previous)
opt="$opt track"
;;
+ vol)
+ opt="set sound volume to $1" #$1 Due to the shift
+ ;;
""|-h|--help)
echo "Usage: itunes <option>"
echo "option:"
echo "\tlaunch|play|pause|stop|rewind|resume|quit"
echo "\tmute|unmute\tcontrol volume set"
echo "\tnext|previous\tplay next or previous track"
+ echo "\tvol\tSet the volume, takes an argument from 0 to 100"
echo "\thelp\tshow this message and exit"
return 0
;;
@@ -190,4 +194,3 @@ function itunes() {
esac
osascript -e "tell application \"iTunes\" to $opt"
}
-
diff --git a/plugins/postgres/postgres.plugin.zsh b/plugins/postgres/postgres.plugin.zsh
index cdd142e92..c2dbef244 100644
--- a/plugins/postgres/postgres.plugin.zsh
+++ b/plugins/postgres/postgres.plugin.zsh
@@ -1,6 +1,8 @@
-# Aliases to stop, start and restart Postgres
-# Paths noted below are for Postgress installed via Homebrew on OSX
+# Aliases to control Postgres
+# Paths noted below are for Postgres installed via Homebrew on OSX
alias startpost='pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start'
alias stoppost='pg_ctl -D /usr/local/var/postgres stop -s -m fast'
-alias restartpost='stoppost && sleep 1 && startpost' \ No newline at end of file
+alias restartpost='stoppost && sleep 1 && startpost'
+alias reloadpost='pg_ctl reload -D /usr/local/var/postgres -s'
+alias statuspost='pg_ctl status -D /usr/local/var/postgres -s' \ No newline at end of file
diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh
index 3bde154df..ad23e18d7 100644
--- a/plugins/rvm/rvm.plugin.zsh
+++ b/plugins/rvm/rvm.plugin.zsh
@@ -6,6 +6,7 @@ alias gemsets='rvm gemset list'
local ruby18='ruby-1.8.7'
local ruby19='ruby-1.9.3'
local ruby20='ruby-2.0.0'
+local ruby21='ruby-2.1.1'
function rb18 {
if [ -z "$1" ]; then
@@ -40,6 +41,17 @@ function rb20 {
_rb20() {compadd `ls -1 $rvm_path/gems | grep "^$ruby20@" | sed -e "s/^$ruby20@//" | awk '{print $1}'`}
compdef _rb20 rb20
+function rb21 {
+ if [ -z "$1" ]; then
+ rvm use "$ruby21"
+ else
+ rvm use "$ruby21@$1"
+ fi
+}
+
+_rb21() {compadd `ls -1 $rvm_path/gems | grep "^$ruby21@" | sed -e "s/^$ruby21@//" | awk '{print $1}'`}
+compdef _rb21 rb21
+
function rvm-update {
rvm get head
}
diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh
index 96a3426fc..9ebad6808 100755
--- a/plugins/wd/wd.sh
+++ b/plugins/wd/wd.sh
@@ -58,7 +58,7 @@ wd_warp()
#wd_print_msg $BLUE "Warping..."
cd ${points[$1]}
else
- wd_print_msg $RED "Unkown warp point '$1'"
+ wd_print_msg $RED "Unknown warp point '$1'"
fi
}