diff options
-rw-r--r-- | lib/completion.zsh | 9 | ||||
-rw-r--r-- | lib/git.zsh | 4 | ||||
-rw-r--r-- | plugins/bundler/bundler.plugin.zsh | 3 | ||||
-rw-r--r-- | plugins/gas/_gas | 34 | ||||
-rw-r--r-- | plugins/git/git.plugin.zsh | 4 | ||||
-rw-r--r-- | plugins/heroku/_heroku | 158 | ||||
-rw-r--r-- | plugins/history-substring-search/README (renamed from README) | 0 | ||||
-rw-r--r-- | plugins/history-substring-search/history-substring-search.plugin.zsh (renamed from history-substring-search.plugin.zsh) | 0 | ||||
-rw-r--r-- | plugins/history-substring-search/history-substring-search.zsh (renamed from history-substring-search.zsh) | 0 | ||||
-rw-r--r-- | plugins/lol/lol.plugin.zsh | 11 | ||||
-rw-r--r-- | plugins/powder/_powder | 4 | ||||
-rw-r--r-- | plugins/svn/svn.plugin.zsh | 4 | ||||
-rw-r--r-- | templates/zshrc.zsh-template | 3 | ||||
-rw-r--r-- | tools/upgrade.sh | 18 |
14 files changed, 239 insertions, 13 deletions
diff --git a/lib/completion.zsh b/lib/completion.zsh index fdd0a8536..b3cc91822 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -59,3 +59,12 @@ zstyle ':completion:*:*:*:users' ignored-patterns \ # ... unless we really want to. zstyle '*' single-ignored show +if [ "x$COMPLETION_WAITING_DOTS" = "xtrue" ]; then + expand-or-complete-with-dots() { + echo -n "\e[31m......\e[0m" + zle expand-or-complete + zle redisplay + } + zle -N expand-or-complete-with-dots + bindkey "^I" expand-or-complete-with-dots +fi diff --git a/lib/git.zsh b/lib/git.zsh index ce4de5598..f04343650 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -52,7 +52,9 @@ git_prompt_status() { if $(echo "$INDEX" | grep '^R ' &> /dev/null); then STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS" fi - if $(echo "$INDEX" | grep '^D ' &> /dev/null); then + if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" + elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" fi if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index e98bb4b46..a6c116407 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -2,10 +2,11 @@ alias be="bundle exec" alias bi="bundle install" alias bl="bundle list" alias bu="bundle update" +alias bp="bundle package" # The following is based on https://github.com/gma/bundler-exec -bundled_commands=(cap capify cucumber heroku rackup rails rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) +bundled_commands=(cap capify cucumber guard heroku rackup rails rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) ## Functions diff --git a/plugins/gas/_gas b/plugins/gas/_gas new file mode 100644 index 000000000..befdc9459 --- /dev/null +++ b/plugins/gas/_gas @@ -0,0 +1,34 @@ +#compdef gas + +local curcontext="$curcontext" state line cmds ret=1 + +_arguments -C \ + '(- 1 *)'{-v,--version}'[display version information]' \ + '(-h|--help)'{-h,--help}'[show help information]' \ + '1: :->cmds' \ + '*: :->args' && ret=0 + +case $state in + cmds) + cmds=( + "version:Prints Gas's version" + "use:Uses author" + "show:Shows your current user" + "list:Lists your authors" + "import:Imports current user to gasconfig" + "help:Describe available tasks or one specific task" + "delete:Deletes author" + "add:Adds author to gasconfig" + ) + _describe -t commands 'gas command' cmds && ret=0 + ;; + args) + case $line[1] in + (use|delete) + _values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0 + ;; + esac + ;; +esac + +return ret diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 5132b639a..4fcf9425d 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -29,6 +29,10 @@ alias glg='git log --stat --max-count=5' compdef _git glg=git-log alias glgg='git log --graph --max-count=5' compdef _git glgg=git-log +alias gss='git status -s' +compdef _git gss=git-status +alias ga='git add' +compdef _git ga=git-add # Git and svn mix alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' diff --git a/plugins/heroku/_heroku b/plugins/heroku/_heroku new file mode 100644 index 000000000..dc899e2b2 --- /dev/null +++ b/plugins/heroku/_heroku @@ -0,0 +1,158 @@ +#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 + diff --git a/README b/plugins/history-substring-search/README index be11adf76..be11adf76 100644 --- a/README +++ b/plugins/history-substring-search/README diff --git a/history-substring-search.plugin.zsh b/plugins/history-substring-search/history-substring-search.plugin.zsh index 99a5922c5..99a5922c5 100644 --- a/history-substring-search.plugin.zsh +++ b/plugins/history-substring-search/history-substring-search.plugin.zsh diff --git a/history-substring-search.zsh b/plugins/history-substring-search/history-substring-search.zsh index 53f707c79..53f707c79 100644 --- a/history-substring-search.zsh +++ b/plugins/history-substring-search/history-substring-search.zsh diff --git a/plugins/lol/lol.plugin.zsh b/plugins/lol/lol.plugin.zsh index a7153bb57..e455527e7 100644 --- a/plugins/lol/lol.plugin.zsh +++ b/plugins/lol/lol.plugin.zsh @@ -8,19 +8,30 @@ alias rtfm='man' alias visible='echo' alias invisible='cat' alias moar='more' +alias tldr='less' +alias alwayz='tail -f' alias icanhas='mkdir' +alias gimmeh='touch' alias donotwant='rm' alias dowant='cp' alias gtfo='mv' +alias nowai='chmod' alias hai='cd' +alias iz='ls' alias plz='pwd' +alias ihasbucket='df -h' alias inur='locate' +alias iminurbase='finger' + +alias btw='nice' +alias obtw='nohup' alias nomz='ps -aux' alias nomnom='killall' +alias byes='exit' alias cya='reboot' alias kthxbai='halt' diff --git a/plugins/powder/_powder b/plugins/powder/_powder new file mode 100644 index 000000000..84e260a15 --- /dev/null +++ b/plugins/powder/_powder @@ -0,0 +1,4 @@ +#compdef powder +#autoload + +compadd `powder help | grep powder | cut -d " " -f 4` diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh index 86050227d..53a8a513a 100644 --- a/plugins/svn/svn.plugin.zsh +++ b/plugins/svn/svn.plugin.zsh @@ -1,5 +1,5 @@ function svn_prompt_info { - if [[ -d .svn ]]; then + if [ in_svn ]; then echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\ $ZSH_THEME_REPO_NAME_COLOR$(svn_get_repo_name)$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$ZSH_PROMPT_BASE_COLOR" fi @@ -28,7 +28,7 @@ function svn_get_rev_nr { function svn_dirty_choose { if [ in_svn ]; then - s=$(svn status 2>/dev/null) + s=$(svn status|grep -E '^\s*[ACDIM!?L]' 2>/dev/null) if [ $s ]; then echo $1 else diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 77f866d52..1ab40aba6 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -19,6 +19,9 @@ ZSH_THEME="robbyrussell" # Uncomment following line if you want to disable autosetting terminal title. # DISABLE_AUTO_TITLE="true" +# Uncomment following line if you want red dots to be displayed while waiting for completion +# COMPLETION_WAITING_DOTS="true" + # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) # Example format: plugins=(rails git textmate ruby lighthouse) plugins=(git) diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 2b75e5541..52a8cc4da 100644 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -1,12 +1,12 @@ current_path=`pwd` -echo "\033[0;34mUpgrading Oh My Zsh\033[0m" +echo -e "\033[0;34mUpgrading Oh My Zsh\033[0m" ( cd $ZSH && git pull origin master ) -echo "\033[0;32m"' __ __ '"\033[0m" -echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" -echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" -echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" -echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" -echo "\033[0;32m"' /____/ '"\033[0m" -echo "\033[0;34mHooray! Oh My Zsh has been updated and/or is at the current version.\033[0m" -echo "\033[0;34mTo keep up on the latest, be sure to follow Oh My Zsh on twitter: \033[1mhttp://twitter.com/ohmyzsh\033[0m" +echo -e "\033[0;32m"' __ __ '"\033[0m" +echo -e "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" +echo -e "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" +echo -e "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" +echo -e "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" +echo -e "\033[0;32m"' /____/ '"\033[0m" +echo -e "\033[0;34mHooray! Oh My Zsh has been updated and/or is at the current version.\033[0m" +echo -e "\033[0;34mTo keep up on the latest, be sure to follow Oh My Zsh on twitter: \033[1mhttp://twitter.com/ohmyzsh\033[0m" cd "$current_path" |