Commit 772bc51c authored by James Smith's avatar James Smith
Browse files

Merge

parents 0ba398f9 d05b2010
...@@ -12,7 +12,7 @@ dirpersistinstall () { ...@@ -12,7 +12,7 @@ dirpersistinstall () {
if grep 'dirpersiststore' ~/.zlogout > /dev/null; then if grep 'dirpersiststore' ~/.zlogout > /dev/null; then
else else
if read -q \?"Would you like to set up your .zlogout file for use with dirspersist? (y/n) "; then if read -q \?"Would you like to set up your .zlogout file for use with dirspersist? (y/n) "; then
echo "# Store dirs stack\n# See ~/.oh-my-zsh/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~/.zlogout echo "# Store dirs stack\n# See $ZSH/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~/.zlogout
else else
echo "If you don't want this message to appear, remove dirspersist from \$plugins" echo "If you don't want this message to appear, remove dirspersist from \$plugins"
fi fi
......
...@@ -220,3 +220,4 @@ _managepy() { ...@@ -220,3 +220,4 @@ _managepy() {
compdef _managepy manage.py compdef _managepy manage.py
compdef _managepy django compdef _managepy django
compdef _managepy django-manage
encode64(){ echo -n $1 | base64 }
decode64(){ echo -n $1 | base64 -D }
\ No newline at end of file
...@@ -78,8 +78,3 @@ function extract() { ...@@ -78,8 +78,3 @@ function extract() {
alias x=extract alias x=extract
# add extract completion function to path
fpath=($ZSH/plugins/extract $fpath)
autoload -U compinit
compinit -i
if [ $commands[fasd] ]; then # check if fasd is installed
eval "$(fasd --init auto)"
alias v='f -e vim'
alias o='a -e open'
fi
...@@ -110,6 +110,8 @@ __git-flow-release () ...@@ -110,6 +110,8 @@ __git-flow-release ()
-u'[Use the given GPG-key for the digital signature (implies -s)]'\ -u'[Use the given GPG-key for the digital signature (implies -s)]'\
-m'[Use the given tag message]'\ -m'[Use the given tag message]'\
-p'[Push to $ORIGIN after performing finish]'\ -p'[Push to $ORIGIN after performing finish]'\
-k'[Keep branch after performing finish]'\
-n"[Don't tag this release]"\
':version:__git_flow_version_list' ':version:__git_flow_version_list'
;; ;;
...@@ -162,6 +164,8 @@ __git-flow-hotfix () ...@@ -162,6 +164,8 @@ __git-flow-hotfix ()
-u'[Use the given GPG-key for the digital signature (implies -s)]'\ -u'[Use the given GPG-key for the digital signature (implies -s)]'\
-m'[Use the given tag message]'\ -m'[Use the given tag message]'\
-p'[Push to $ORIGIN after performing finish]'\ -p'[Push to $ORIGIN after performing finish]'\
-k'[Keep branch after performing finish]'\
-n"[Don't tag this release]"\
':hotfix:__git_flow_hotfix_list' ':hotfix:__git_flow_hotfix_list'
;; ;;
......
...@@ -9,7 +9,7 @@ alias gup='git fetch && git rebase' ...@@ -9,7 +9,7 @@ alias gup='git fetch && git rebase'
compdef _git gup=git-fetch compdef _git gup=git-fetch
alias gp='git push' alias gp='git push'
compdef _git gp=git-push compdef _git gp=git-push
gdv() { git-diff -w "$@" | view - } gdv() { git diff -w "$@" | view - }
compdef _git gdv=git-diff compdef _git gdv=git-diff
alias gc='git commit -v' alias gc='git commit -v'
compdef _git gc=git-commit compdef _git gc=git-commit
...@@ -17,6 +17,7 @@ alias gca='git commit -v -a' ...@@ -17,6 +17,7 @@ alias gca='git commit -v -a'
compdef _git gca=git-commit compdef _git gca=git-commit
alias gco='git checkout' alias gco='git checkout'
compdef _git gco=git-checkout compdef _git gco=git-checkout
alias gcm='git checkout master'
alias gb='git branch' alias gb='git branch'
compdef _git gb=git-branch compdef _git gb=git-branch
alias gba='git branch -a' alias gba='git branch -a'
...@@ -29,6 +30,14 @@ alias glg='git log --stat --max-count=5' ...@@ -29,6 +30,14 @@ alias glg='git log --stat --max-count=5'
compdef _git glg=git-log compdef _git glg=git-log
alias glgg='git log --graph --max-count=5' alias glgg='git log --graph --max-count=5'
compdef _git glgg=git-log compdef _git glgg=git-log
alias gss='git status -s'
compdef _git gss=git-status
alias ga='git add'
compdef _git ga=git-add
alias gm='git merge'
compdef _git gm=git-merge
alias grh='git reset HEAD'
alias grhh='git reset HEAD --hard'
# Git and svn mix # Git and svn mix
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
...@@ -45,6 +54,12 @@ function current_branch() { ...@@ -45,6 +54,12 @@ function current_branch() {
echo ${ref#refs/heads/} echo ${ref#refs/heads/}
} }
function current_repository() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo $(git remote -v | cut -d':' -f 2)
}
# these aliases take advantage of the previous function # these aliases take advantage of the previous function
alias ggpull='git pull origin $(current_branch)' alias ggpull='git pull origin $(current_branch)'
compdef ggpull=git compdef ggpull=git
......
# hub alias from defunkt # Setup hub function for git, if it is available; http://github.com/defunkt/hub
# https://github.com/defunkt/hub if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then
if [ "$commands[(I)hub]" ]; then
# eval `hub alias -s zsh` # eval `hub alias -s zsh`
function git(){hub "$@"} function git(){
if ! (( $+_has_working_hub )); then
hub --version &> /dev/null
_has_working_hub=$(($? == 0))
fi
if (( $_has_working_hub )) ; then
hub "$@"
else
command git "$@"
fi
}
fi fi
# Functions #################################################################
# https://github.com/dbb
# empty_gh [NAME_OF_REPO]
#
# Use this when creating a new repo from scratch.
empty_gh() { # [NAME_OF_REPO]
repo = $1
ghuser=$( git config github.user )
mkdir "$repo"
cd "$repo"
git init
touch README
git add README
git commit -m 'Initial commit.'
git remote add origin git@github.com:${ghuser}/${repo}.git
git push -u origin master
}
# new_gh [DIRECTORY]
#
# Use this when you have a directory that is not yet set up for git.
# This function will add all non-hidden files to git.
new_gh() { # [DIRECTORY]
cd "$1"
ghuser=$( git config github.user )
git init
# add all non-dot files
print '.*'"\n"'*~' >> .gitignore
git add ^.*
git commit -m 'Initial commit.'
git remote add origin git@github.com:${ghuser}/${repo}.git
git push -u origin master
}
# exist_gh [DIRECTORY]
#
# Use this when you have a git repo that's ready to go and you want to add it
# to your GitHub.
exist_gh() { # [DIRECTORY]
cd "$1"
name=$( git config user.name )
ghuser=$( git config github.user )
git remote add origin git@github.com:${ghuser}/${repo}.git
git push -u origin master
}
# End Functions #############################################################
# ------------------------------------------------------------------------------
# FILE: gnu-utils.plugin.zsh
# DESCRIPTION: oh-my-zsh plugin file.
# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com)
# VERSION: 1.0.0
# ------------------------------------------------------------------------------
if [[ -x "${commands[gwhoami]}" ]]; then
__gnu_utils() {
emulate -L zsh
local gcmds
local gcmd
local cmd
local prefix
# coreutils
gcmds=('g[' 'gbase64' 'gbasename' 'gcat' 'gchcon' 'gchgrp' 'gchmod'
'gchown' 'gchroot' 'gcksum' 'gcomm' 'gcp' 'gcsplit' 'gcut' 'gdate'
'gdd' 'gdf' 'gdir' 'gdircolors' 'gdirname' 'gdu' 'gecho' 'genv' 'gexpand'
'gexpr' 'gfactor' 'gfalse' 'gfmt' 'gfold' 'ggroups' 'ghead' 'ghostid'
'gid' 'ginstall' 'gjoin' 'gkill' 'glink' 'gln' 'glogname' 'gls' 'gmd5sum'
'gmkdir' 'gmkfifo' 'gmknod' 'gmktemp' 'gmv' 'gnice' 'gnl' 'gnohup' 'gnproc'
'god' 'gpaste' 'gpathchk' 'gpinky' 'gpr' 'gprintenv' 'gprintf' 'gptx' 'gpwd'
'greadlink' 'grm' 'grmdir' 'gruncon' 'gseq' 'gsha1sum' 'gsha224sum'
'gsha256sum' 'gsha384sum' 'gsha512sum' 'gshred' 'gshuf' 'gsleep' 'gsort'
'gsplit' 'gstat' 'gstty' 'gsum' 'gsync' 'gtac' 'gtail' 'gtee' 'gtest'
'gtimeout' 'gtouch' 'gtr' 'gtrue' 'gtruncate' 'gtsort' 'gtty' 'guname'
'gunexpand' 'guniq' 'gunlink' 'guptime' 'gusers' 'gvdir' 'gwc' 'gwho'
'gwhoami' 'gyes')
# Not part of coreutils, installed separately.
gcmds+=('gsed' 'gtar' 'gtime')
for gcmd in "${gcmds[@]}"; do
#
# This method allows for builtin commands to be primary but it's
# lost if hash -r or rehash -f is executed. Thus, those two
# functions have to be wrapped.
#
(( ${+commands[$gcmd]} )) && hash ${gcmd[2,-1]}=${commands[$gcmd]}
#
# This method generates wrapper functions.
# It will override shell builtins.
#
# (( ${+commands[$gcmd]} )) && \
# eval "function $gcmd[2,-1]() { \"${prefix}/${gcmd//"["/"\\["}\" \"\$@\"; }"
#
# This method is inflexible since the aliases are at risk of being
# overriden resulting in the BSD coreutils being called.
#
# (( ${+commands[$gcmd]} )) && \
# alias "$gcmd[2,-1]"="${prefix}/${gcmd//"["/"\\["}"
done
return 0
}
__gnu_utils;
function hash() {
if [[ "$*" =~ "-(r|f)" ]]; then
builtin hash "$@"
__gnu_utils
else
builtin hash "$@"
fi
}
function rehash() {
if [[ "$*" =~ "-f" ]]; then
builtin rehash "$@"
__gnu_utils
else
builtin rehash "$@"
fi
}
fi
#!zsh
##############################################################################
# A descriptive listing of core Gradle commands
############################################################################
function _gradle_core_commands() {
local ret=1 state
_arguments ':subcommand:->subcommand' && ret=0
case $state in
subcommand)
subcommands=(
"properties:Display all project properties"
"tasks:Calculate and display all tasks"
"dependencies:Calculate and display all dependencies"
"projects:Discover and display all sub-projects"
"build:Build the project"
"help:Display help"
)
_describe -t subcommands 'gradle subcommands' subcommands && ret=0
esac
return ret
}
function _gradle_arguments() {
_arguments -C \
'-a[Do not rebuild project dependencies]' \
'-h[Help]' \
'-D[System property]' \
'-d[Log at the debug level]' \
'--gui[Launches the Gradle GUI app]' \
'--stop[Stop the Gradle daemon]' \
'--daemon[Use the Gradle daemon]' \
'--no-daemon[Do not use the Gradle daemon]' \
'--no-opt[Do not perform any task optimization]' \
'-i[Log at the info level]' \
'-m[Dry run]' \
'-P[Set a project property]' \
'--profile[Profile the build time]' \
'-q[Log at the quiet level (only show errors)]' \
'-v[Print the Gradle version info]' \
'-x[Specify a task to be excluded]' \
'*::command:->command' \
&& return 0
}
##############################################################################
# Are we in a directory containing a build.gradle file?
############################################################################
function in_gradle() {
if [[ -f build.gradle ]]; then
echo 1
fi
}
############################################################################
# Define the stat_cmd command based on platform behavior
##########################################################################
stat -f%m . > /dev/null 2>&1
if [ "$?" = 0 ]; then
stat_cmd=(stat -f%m)
else
stat_cmd=(stat -L --format=%Y)
fi
############################################################################## Examine the build.gradle file to see if its
# timestamp has changed, and if so, regen
# the .gradle_tasks cache file
############################################################################
_gradle_does_task_list_need_generating () {
if [ ! -f .gradletasknamecache ]; then return 0;
else
accurate=$($stat_cmd .gradletasknamecache)
changed=$($stat_cmd build.gradle)
return $(expr $accurate '>=' $changed)
fi
}
##############################################################################
# Discover the gradle tasks by running "gradle tasks --all"
############################################################################
_gradle_tasks () {
if [ in_gradle ]; then
_gradle_arguments
if _gradle_does_task_list_need_generating; then
gradle tasks --all | grep "^[ ]*[a-zA-Z0-9]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache
fi
compadd -X "==== Gradle Tasks ====" `cat .gradletasknamecache`
fi
}
_gradlew_tasks () {
if [ in_gradle ]; then
_gradle_arguments
if _gradle_does_task_list_need_generating; then
gradlew tasks --all | grep "^[ ]*[a-zA-Z0-9]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache
fi
compadd -X "==== Gradlew Tasks ====" `cat .gradletasknamecache`
fi
}
##############################################################################
# Register the completions against the gradle and gradlew commands
############################################################################
compdef _gradle_tasks gradle
compdef _gradlew_tasks gradlew
##############################################################################
# Open questions for future improvements:
# 1) Should 'gradle tasks' use --all or just the regular set?
# 2) Should gradlew use the same approach as gradle?
# 3) Should only the " - " be replaced with a colon so it can work
# with the richer descriptive method of _arguments?
# gradle tasks | grep "^[a-zA-Z0-9]*\ -\ " | sed "s/ - /\:/"
#############################################################################
_enumerateGrailsScripts() {
# Default directoryies
directories=($GRAILS_HOME/scripts ~/.grails/scripts ./scripts)
# Check all of the plugins directories, if they exist
if [ -d plugins ]
then
directories+=(plugins/*/scripts)
fi
# Enumerate all of the Groovy files
files=()
for dir in $directories;
do
if [ -d $dir ]
then
files+=($dir/[^_]*.groovy)
fi
done
# Don't try to basename ()
if [ ${#files} -eq 0 ];
then
return
fi
# - Strip the path
# - Remove all scripts with a leading '_'
# - PackagePlugin_.groovy -> PackagePlugin
# - PackagePlugin -> Package-Plugin
# - Package-Plugin -> package-plugin
basename $files \
| sed -E -e 's/^_?([^_]+)_?.groovy/\1/'\
-e 's/([a-z])([A-Z])/\1-\2/g' \
| tr "[:upper:]" "[:lower:]" \
| sort \
| uniq
}
_grails() {
if (( CURRENT == 2 )); then
scripts=( $(_enumerateGrailsScripts) )
if [ ${#scripts} -ne 0 ];
then
_multi_parts / scripts
return
fi
fi
_files
}
compdef _grails grails
#compdef heroku
# Heroku Autocomplete plugin for Oh-My-Zsh
# Requires: The Heroku client gem (https://github.com/heroku/heroku)
# Author: Ali B. (http://awhitebox.com)
local -a _1st_arguments
_1st_arguments=(
"account\:confirm_billing":"Confirm that your account can be billed at the end of the month"
"addons":"list installed addons"
"addons\:list":"list all available addons"
"addons\:add":"install an addon"
"addons\:upgrade":"upgrade an existing addon"
"addons\:downgrade":"downgrade an existing addon"
"addons\:remove":"uninstall an addon"
"addons\:open":"open an addon's dashboard in your browser"
"apps":"list your apps"
"apps\:info":"show detailed app information"
"apps\:create":"create a new app"
"apps\:rename":"rename the app"
"apps\:open":"open the app in a web browser"
"apps\:destroy":"permanently destroy an app"
"auth\:login":"log in with your heroku credentials"
"auth\:logout":"clear local authentication credentials"
"config":"display the config vars for an app"
"config\:add":"add one or more config vars"
"config\:remove":"remove a config var"
"db\:push":"push local data up to your app"
"db\:pull":"pull heroku data down into your local database"
"domains":"list custom domains for an app"
"domains\:add":"add a custom domain to an app"
"domains\:remove":"remove a custom domain from an app"
"domains\:clear":"remove all custom domains from an app"
"help":"list available commands or display help for a specific command"
"keys":"display keys for the current user"
"keys\:add":"add a key for the current user"
"keys\:remove":"remove a key from the current user"
"keys\:clear":"remove all authentication keys from the current user"
"logs":"display recent log output"
"logs\:cron":"DEPRECATED: display cron logs from legacy logging"
"logs\:drains":"manage syslog drains"
"maintenance\:on":"put the app into maintenance mode"
"maintenance\:off":"take the app out of maintenance mode"
"pg\:info":"display database information"
"pg\:ingress":"allow direct connections to the database from this IP for one minute"
"pg\:promote":"sets DATABASE as your DATABASE_URL"
"pg\:psql":"open a psql shell to the database"
"pg\:reset":"delete all data in DATABASE"
"pg\:unfollow":"stop a replica from following and make it a read/write database"
"pg\:wait":"monitor database creation, exit when complete"
"pgbackups":"list captured backups"
"pgbackups\:url":"get a temporary URL for a backup"
"pgbackups\:capture":"capture a backup from a database id"
"pgbackups\:restore":"restore a backup to a database"
"pgbackups\:destroy":"destroys a backup"
"plugins":"list installed plugins"
"plugins\:install":"install a plugin"
"plugins\:uninstall":"uninstall a plugin"
"ps\:dynos":"scale to QTY web processes"
"ps\:workers":"scale to QTY background processes"
"ps":"list processes for an app"
"ps\:restart":"restart an app process"
"ps\:scale":"scale processes by the given amount"
"releases":"list releases"
"releases\:info":"view detailed information for a release"
"rollback":"roll back to an older release"
"run":"run an attached process"
"run\:rake":"remotely execute a rake command"
"run\:console":"open a remote console session"
"sharing":"list collaborators on an app"
"sharing\:add":"add a collaborator to an app"
"sharing\:remove":"remove a collaborator from an app"
"sharing\:transfer":"transfer an app to a new owner"
"ssl":"list certificates for an app"
"ssl\:add":"add an ssl certificate to an app"
"ssl\:remove":"remove an ssl certificate from an app"
"ssl\:clear":"remove all ssl certificates from an app"
"stack":"show the list of available stacks"
"stack\:migrate":"prepare migration of this app to a new stack"
"version":"show heroku client version"
)
_arguments '*:: :->command'
if (( CURRENT == 1 )); then
_describe -t commands "heroku command" _1st_arguments
return
fi
local -a _command_args
case "$words[1]" in
apps:info)
_command_args=(
'(-r|--raw)'{-r,--raw}'[output info as raw key/value pairs]' \
)
;;
apps:create)
_command_args=(
'(-a|--addons)'{-a,--addons}'[a list of addons to install]' \
'(-r|--remote)'{-r,--remote}'[the git remote to create, default "heroku"]' \
'(-s|--stack)'{-s,--stack}'[the stack on which to create the app]' \
)
;;
config)
_command_args=(
'(-s|--shell)'{-s,--shell}'[output config vars in shell format]' \
)
;;
db:push)
_command_args=(
'(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \
'(-d|--debug)'{-d,--debug}'[enable debugging output]' \
'(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the push]' \
'(-f|--filter)'{-f,--filter}'[only push certain tables]' \
'(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \
'(-t|--tables)'{-t,--tables}'[only push the specified tables]' \
)
;;
db:pull)
_command_args=(
'(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \
'(-d|--debug)'{-d,--debug}'[enable debugging output]' \
'(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the pull]' \
'(-f|--filter)'{-f,--filter}'[only pull certain tables]' \
'(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \
'(-t|--tables)'{-t,--tables}'[only pull the specified tables]' \
)
;;
keys)
_command_args=(
'(-l|--long)'{-l,--long}'[display extended information for each key]' \
)
;;
logs)
_command_args=(
'(-n|--num)'{-n,--num}'[the number of lines to display]' \
'(-p|--ps)'{-p,--ps}'[only display logs from the given process]' \
'(-s|--source)'{-s,--source}'[only display logs from the given source]' \
'(-t|--tail)'{-t,--tail}'[continually stream logs]' \
)
;;
pgbackups:capture)
_command_args=(
'(-e|--expire)'{-e,--expire}'[if no slots are available to capture, delete the oldest backup to make room]' \
)
;;
stack)
_command_args=(
'(-a|--all)'{-a,--all}'[include deprecated stacks]' \
)
;;
esac
_arguments \
$_command_args \
'(--app)--app[the app name]' \
&& return 0
#---oh-my-zsh plugin : task Autocomplete for Jake tool---
# Jake : https://github.com/mde/jake
# Warning : Jakefile should have the right case : Jakefile or jakefile
# Tested on : MacOSX 10.7 (Lion), Ubuntu 11.10
# Author : Alexandre Lacheze (@al3xstrat)
# Inspiration : http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh
function _jake () {
if [ -f Jakefile ]||[ -f jakefile ]; then
compadd `jake -T | cut -d " " -f 2 | sed -E "s/.\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"`
fi
}
compdef _jake jake
\ No newline at end of file
# Aliases
alias jrspec='jruby --debug -S rspec --debug'
alias jprofile='jruby --profile.api -S rspec'
alias jexec='jruby -S'
...@@ -26,7 +26,7 @@ _knife() { ...@@ -26,7 +26,7 @@ _knife() {
case $state in case $state in
knifecmd) knifecmd)
compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec index node recipe role search ssh status windows $cloudproviders compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec environment index node recipe role search ssh status windows $cloudproviders
;; ;;
knifesubcmd) knifesubcmd)
case $words[2] in case $words[2] in
...@@ -42,6 +42,9 @@ _knife() { ...@@ -42,6 +42,9 @@ _knife() {
cookbook) cookbook)
compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload
;; ;;
environment)
compadd -Q "$@" list create delete edit show "from file"
;;
node) node)
compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete" compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete"
;; ;;
...@@ -138,27 +141,31 @@ _knife_options3() { ...@@ -138,27 +141,31 @@ _knife_options3() {
# The chef_x_remote functions use knife to get a list of objects of type x on the server # The chef_x_remote functions use knife to get a list of objects of type x on the server
_chef_roles_remote() { _chef_roles_remote() {
(knife role list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') (knife role list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
} }
_chef_clients_remote() { _chef_clients_remote() {
(knife client list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') (knife client list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
} }
_chef_nodes_remote() { _chef_nodes_remote() {
(knife node list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') (knife node list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
} }
_chef_cookbooks_remote() { _chef_cookbooks_remote() {
(knife cookbook list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') (knife cookbook list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
} }
_chef_sitecookbooks_remote() { _chef_sitecookbooks_remote() {
(knife cookbook site list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') (knife cookbook site list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
} }
_chef_data_bags_remote() { _chef_data_bags_remote() {
(knife data bag list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') (knife data bag list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
}
_chef_environments_remote() {
(knife environment list | awk '{print $1}')
} }
# The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server # The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server
......
...@@ -8,19 +8,30 @@ alias rtfm='man' ...@@ -8,19 +8,30 @@ alias rtfm='man'
alias visible='echo' alias visible='echo'
alias invisible='cat' alias invisible='cat'
alias moar='more' alias moar='more'
alias tldr='less'
alias alwayz='tail -f'
alias icanhas='mkdir' alias icanhas='mkdir'
alias gimmeh='touch'
alias donotwant='rm' alias donotwant='rm'
alias dowant='cp' alias dowant='cp'
alias gtfo='mv' alias gtfo='mv'
alias nowai='chmod'
alias hai='cd' alias hai='cd'
alias iz='ls'
alias plz='pwd' alias plz='pwd'
alias ihasbucket='df -h'
alias inur='locate' alias inur='locate'
alias iminurbase='finger'
alias nomz='ps -aux' alias btw='nice'
alias obtw='nohup'
alias nomz='ps aux'
alias nomnom='killall' alias nomnom='killall'
alias byes='exit'
alias cya='reboot' alias cya='reboot'
alias kthxbai='halt' alias kthxbai='halt'
# Mercurial
alias hgc='hg commit'
alias hgb='hg branch'
alias hgba='hg branches'
alias hgco='hg checkout'
alias hgd='hg diff'
alias hged='hg diffmerge'
# pull and update
alias hgl='hg pull -u'
alias hgp='hg push'
alias hgs='hg status'
# this is the 'git commit --amend' equivalent
alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip'
function listMavenCompletions {
reply=(
cli:execute cli:execute-phase archetype:generate generate-sources compile clean install test test-compile deploy package cobertura:cobertura jetty:run gwt:run gwt:debug -DskipTests -Dmaven.test.skip=true -DarchetypeCatalog=http://tapestry.formos.com/maven-snapshot-repository -Dtest= `if [ -d ./src ] ; then find ./src -type f | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi`);
}
compctl -K listMavenCompletions mvn
\ No newline at end of file
#compdef npm
# Node Package Manager 0.3.15 completion, letting npm do all the completion work
_npm() {
compadd -- $(_npm_complete $words)
}
# We want to show all errors of any substance, but never the "npm (not )ok" one.
# (Also doesn't consider "ERR! no match found" worth breaking the terminal for.)
_npm_complete() {
local ask_npm
ask_npm=(npm completion --color false --loglevel error -- $@)
{ _call_program npm $ask_npm 2>&1 >&3 \
| egrep -v '^(npm (not |)ok|ERR! no match found)$' >&2; \
} 3>&1
}
_npm "$@"
eval "$(npm completion 2>/dev/null)"
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