From 93b185fd57cbac76c3bcb3553d04d085d3d771b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20K=C3=B6nig?= Date: Tue, 1 Apr 2014 23:06:53 +0200 Subject: [PATCH 1/3] A plugin that provides autocompletion for your gulp.js tasks. --- plugins/gulp/gulp.plugin.zsh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 plugins/gulp/gulp.plugin.zsh diff --git a/plugins/gulp/gulp.plugin.zsh b/plugins/gulp/gulp.plugin.zsh new file mode 100644 index 000000000..6017c7b60 --- /dev/null +++ b/plugins/gulp/gulp.plugin.zsh @@ -0,0 +1,29 @@ +#!/usr/bin/env zsh + +# +# gulp-autocompletion-zsh +# +# Autocompletion for your gulp.js tasks +# +# Copyright(c) 2014 André König +# MIT Licensed +# + +# +# André König +# Github: https://github.com/akoenig +# Twitter: https://twitter.com/caiifr +# + +# +# Grabs all available tasks from the `gulpfile.js` +# in the current directory. +# +function $$gulp_completion() { + compls=$(grep -Eo "gulp.task\(('(([a-zA-Z0-9]|-)*)',)" gulpfile.js 2>/dev/null | grep -Eo "'(([a-zA-Z0-9]|-)*)'" | sed s/"'"//g | sort) + + completions=(${=compls}) + compadd -- $completions +} + +compdef $$gulp_completion gulp \ No newline at end of file From 1b3f4c1cd69164a86b8fc549a7bf761262fb9723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20K=C3=B6nig?= Date: Sat, 16 Aug 2014 10:50:49 +0200 Subject: [PATCH 2/3] Modified nvm plugin to fit my needs. --- .gitignore | 3 --- custom/example.zsh | 5 ----- custom/plugins/example/example.plugin.zsh | 2 -- custom/plugins/nvm/_nvm | 26 +++++++++++++++++++++++ custom/plugins/nvm/nvm.plugin.zsh | 11 ++++++++++ 5 files changed, 37 insertions(+), 10 deletions(-) delete mode 100644 custom/example.zsh delete mode 100644 custom/plugins/example/example.plugin.zsh create mode 100644 custom/plugins/nvm/_nvm create mode 100644 custom/plugins/nvm/nvm.plugin.zsh diff --git a/.gitignore b/.gitignore index 8fa66f02f..010447c73 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,6 @@ locals.zsh log/.zsh_history projects.zsh -custom -!custom/plugins/example -!custom/example.zsh *.swp !custom/example.zshcache cache/ diff --git a/custom/example.zsh b/custom/example.zsh deleted file mode 100644 index 28ffcae25..000000000 --- a/custom/example.zsh +++ /dev/null @@ -1,5 +0,0 @@ -# Add yourself some shortcuts to projects you often work on -# Example: -# -# brainstormr=/Users/robbyrussell/Projects/development/planetargon/brainstormr -# \ No newline at end of file diff --git a/custom/plugins/example/example.plugin.zsh b/custom/plugins/example/example.plugin.zsh deleted file mode 100644 index 406f27445..000000000 --- a/custom/plugins/example/example.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -# Add your own custom plugins in the custom/plugins directory. Plugins placed -# here will override ones with the same name in the main plugins directory. diff --git a/custom/plugins/nvm/_nvm b/custom/plugins/nvm/_nvm new file mode 100644 index 000000000..a95c9e375 --- /dev/null +++ b/custom/plugins/nvm/_nvm @@ -0,0 +1,26 @@ +#compdef nvm +#autoload + +[[ -s ~/.nvm/nvm.sh ]] || return 0 + +local -a _1st_arguments +_1st_arguments=( + 'help:show help' + 'install:download and install a version' + 'uninstall:uninstall a version' + 'use:modify PATH to use version' + 'run:run version with given arguments' + 'ls:list installed versions or versions matching a given description' + 'ls-remote:list remote versions available for install' + 'deactivate:undo effects of NVM on current shell' + 'alias:show or set aliases' + 'unalias:deletes an alias' + 'copy-packages:install global NPM packages to current version' +) + +_arguments -C '*:: :->subcmds' && return 0 + +if (( CURRENT == 1 )); then + _describe -t commands "nvm subcommand" _1st_arguments + return +fi \ No newline at end of file diff --git a/custom/plugins/nvm/nvm.plugin.zsh b/custom/plugins/nvm/nvm.plugin.zsh new file mode 100644 index 000000000..a8e0bfb5e --- /dev/null +++ b/custom/plugins/nvm/nvm.plugin.zsh @@ -0,0 +1,11 @@ +# The addition 'nvm install' attempts in ~/.profile + +if [ -s ~/.nvm/nvm.sh ]; then + . $HOME/.nvm/nvm.sh + + # Check if the NODE_VERSION environment variable is set, + # if so trigger nvm to use this. + if [[ $NODE_VERSION != "" ]]; then + nvm use $NODE_VERSION > /dev/null + fi +fi From 3e75e91d1e5f92f6c1476aff75ad3a3d3179c50c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20K=C3=B6nig?= Date: Mon, 1 Sep 2014 15:04:34 +0200 Subject: [PATCH 3/3] Reverted to ed0c5b6875ffa70699a111581fb2e5ac05cf9d5a --- .gitignore | 3 +++ custom/example.zsh | 5 +++++ custom/plugins/example/example.plugin.zsh | 2 ++ custom/plugins/nvm/_nvm | 26 ----------------------- custom/plugins/nvm/nvm.plugin.zsh | 11 ---------- 5 files changed, 10 insertions(+), 37 deletions(-) create mode 100644 custom/example.zsh create mode 100644 custom/plugins/example/example.plugin.zsh delete mode 100644 custom/plugins/nvm/_nvm delete mode 100644 custom/plugins/nvm/nvm.plugin.zsh diff --git a/.gitignore b/.gitignore index 010447c73..8fa66f02f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ locals.zsh log/.zsh_history projects.zsh +custom +!custom/plugins/example +!custom/example.zsh *.swp !custom/example.zshcache cache/ diff --git a/custom/example.zsh b/custom/example.zsh new file mode 100644 index 000000000..28ffcae25 --- /dev/null +++ b/custom/example.zsh @@ -0,0 +1,5 @@ +# Add yourself some shortcuts to projects you often work on +# Example: +# +# brainstormr=/Users/robbyrussell/Projects/development/planetargon/brainstormr +# \ No newline at end of file diff --git a/custom/plugins/example/example.plugin.zsh b/custom/plugins/example/example.plugin.zsh new file mode 100644 index 000000000..406f27445 --- /dev/null +++ b/custom/plugins/example/example.plugin.zsh @@ -0,0 +1,2 @@ +# Add your own custom plugins in the custom/plugins directory. Plugins placed +# here will override ones with the same name in the main plugins directory. diff --git a/custom/plugins/nvm/_nvm b/custom/plugins/nvm/_nvm deleted file mode 100644 index a95c9e375..000000000 --- a/custom/plugins/nvm/_nvm +++ /dev/null @@ -1,26 +0,0 @@ -#compdef nvm -#autoload - -[[ -s ~/.nvm/nvm.sh ]] || return 0 - -local -a _1st_arguments -_1st_arguments=( - 'help:show help' - 'install:download and install a version' - 'uninstall:uninstall a version' - 'use:modify PATH to use version' - 'run:run version with given arguments' - 'ls:list installed versions or versions matching a given description' - 'ls-remote:list remote versions available for install' - 'deactivate:undo effects of NVM on current shell' - 'alias:show or set aliases' - 'unalias:deletes an alias' - 'copy-packages:install global NPM packages to current version' -) - -_arguments -C '*:: :->subcmds' && return 0 - -if (( CURRENT == 1 )); then - _describe -t commands "nvm subcommand" _1st_arguments - return -fi \ No newline at end of file diff --git a/custom/plugins/nvm/nvm.plugin.zsh b/custom/plugins/nvm/nvm.plugin.zsh deleted file mode 100644 index a8e0bfb5e..000000000 --- a/custom/plugins/nvm/nvm.plugin.zsh +++ /dev/null @@ -1,11 +0,0 @@ -# The addition 'nvm install' attempts in ~/.profile - -if [ -s ~/.nvm/nvm.sh ]; then - . $HOME/.nvm/nvm.sh - - # Check if the NODE_VERSION environment variable is set, - # if so trigger nvm to use this. - if [[ $NODE_VERSION != "" ]]; then - nvm use $NODE_VERSION > /dev/null - fi -fi