commit
772bc51c3a
106 changed files with 2447 additions and 302 deletions
@ -1,3 +1,9 @@ |
||||
if [ -f `brew --prefix`/etc/autojump ]; then |
||||
if [ $commands[autojump] ]; then # check if autojump is installed |
||||
if [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package |
||||
. /usr/share/autojump/autojump.zsh |
||||
elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation |
||||
. /etc/profile.d/autojump.zsh |
||||
elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump ]; then # mac os x with brew |
||||
. `brew --prefix`/etc/autojump |
||||
fi |
||||
fi |
||||
|
||||
@ -0,0 +1,20 @@ |
||||
if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then |
||||
function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" } |
||||
function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') } |
||||
function battery_pct_prompt() { |
||||
b=$(battery_pct_remaining) |
||||
if [ $b -gt 50 ] ; then |
||||
color='green' |
||||
elif [ $b -gt 20 ] ; then |
||||
color='yellow' |
||||
else |
||||
color='red' |
||||
fi |
||||
echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}" |
||||
} |
||||
else |
||||
error_msg='no battery' |
||||
function battery_pct_remaining() { echo $error_msg } |
||||
function battery_time_remaining() { echo $error_msg } |
||||
function battery_pct_prompt() { echo '' } |
||||
fi |
||||
@ -0,0 +1,82 @@ |
||||
#compdef bundle |
||||
|
||||
local curcontext="$curcontext" state line _gems _opts ret=1 |
||||
|
||||
_arguments -C -A "-v" -A "--version" \ |
||||
'(- 1 *)'{-v,--version}'[display version information]' \ |
||||
'1: :->cmds' \ |
||||
'*:: :->args' && ret=0 |
||||
|
||||
case $state in |
||||
cmds) |
||||
_values "bundle command" \ |
||||
"install[Install the gems specified by the Gemfile or Gemfile.lock]" \ |
||||
"update[Update dependencies to their latest versions]" \ |
||||
"package[Package the .gem files required by your application]" \ |
||||
"exec[Execute a script in the context of the current bundle]" \ |
||||
"config[Specify and read configuration options for bundler]" \ |
||||
"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]" \ |
||||
"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]" \ |
||||
"help[Describe available tasks or one specific task]" |
||||
ret=0 |
||||
;; |
||||
args) |
||||
case $line[1] in |
||||
help) |
||||
_values 'commands' \ |
||||
'install' \ |
||||
'update' \ |
||||
'package' \ |
||||
'exec' \ |
||||
'config' \ |
||||
'check' \ |
||||
'list' \ |
||||
'show' \ |
||||
'console' \ |
||||
'open' \ |
||||
'viz' \ |
||||
'init' \ |
||||
'gem' \ |
||||
'help' && ret=0 |
||||
;; |
||||
install) |
||||
_arguments \ |
||||
'(--no-color)--no-color[disable colorization in output]' \ |
||||
'(--local)--local[do not attempt to connect to rubygems.org]' \ |
||||
'(--quiet)--quiet[only output warnings and errors]' \ |
||||
'(--gemfile)--gemfile=-[use the specified gemfile instead of Gemfile]:gemfile' \ |
||||
'(--system)--system[install to the system location]' \ |
||||
'(--deployment)--deployment[install using defaults tuned for deployment environments]' \ |
||||
'(--frozen)--frozen[do not allow the Gemfile.lock to be updated after this install]' \ |
||||
'(--path)--path=-[specify a different path than the system default]:path:_files' \ |
||||
'(--binstubs)--binstubs=-[generate bin stubs for bundled gems to ./bin]:directory:_files' \ |
||||
'(--without)--without=-[exclude gems that are part of the specified named group]:groups' |
||||
ret=0 |
||||
;; |
||||
exec) |
||||
_normal && ret=0 |
||||
;; |
||||
(open|show) |
||||
_gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') ) |
||||
if [[ $_gems != "" ]]; then |
||||
_values 'gems' $_gems && ret=0 |
||||
fi |
||||
;; |
||||
*) |
||||
_opts=( $(bundle help $line[1] | sed -e '/^ \[-/!d; s/^ \[\(-[^=]*\)=.*/\1/') ) |
||||
_opts+=( $(bundle help $line[1] | sed -e '/^ -/!d; s/^ \(-.\), \[\(-[^=]*\)=.*/\1 \2/') ) |
||||
if [[ $_opts != "" ]]; then |
||||
_values 'options' $_opts && ret=0 |
||||
fi |
||||
;; |
||||
esac |
||||
;; |
||||
esac |
||||
|
||||
return ret |
||||
@ -1,13 +0,0 @@ |
||||
# Aliases |
||||
alias as="aptitude -F \"* %p -> %d \n(%v/%V)\" \ |
||||
--no-gui --disable-columns search" # search package |
||||
alias ad="sudo apt-get update" # update packages lists |
||||
alias au="sudo apt-get update && \ |
||||
sudo apt-get dselect-upgrade" # upgrade packages |
||||
alias ai="sudo apt-get install" # install package |
||||
alias ar="sudo apt-get remove --purge && \ |
||||
sudo apt-get autoremove --purge" # remove package |
||||
alias ap="apt-cache policy" # apt policy |
||||
alias av="apt-cache show" # show package info |
||||
alias acs="apt-cache search" # search package |
||||
alias ac="sudo apt-get clean && sudo apt-get autoclean" # clean apt cache |
||||
@ -0,0 +1,10 @@ |
||||
## |
||||
# dircycle plugin: enables cycling through the directory |
||||
# stack using Ctrl+Shift+Left/Right |
||||
|
||||
eval "insert-cycledleft () { zle push-line; LBUFFER='pushd -q +1'; zle accept-line }" |
||||
zle -N insert-cycledleft |
||||
bindkey "\e[1;6D" insert-cycledleft |
||||
eval "insert-cycledright () { zle push-line; LBUFFER='pushd -q -0'; zle accept-line }" |
||||
zle -N insert-cycledright |
||||
bindkey "\e[1;6C" insert-cycledright |
||||
@ -0,0 +1,2 @@ |
||||
encode64(){ echo -n $1 | base64 } |
||||
decode64(){ echo -n $1 | base64 -D } |
||||
@ -0,0 +1,6 @@ |
||||
if [ $commands[fasd] ]; then # check if fasd is installed |
||||
eval "$(fasd --init auto)" |
||||
alias v='f -e vim' |
||||
alias o='a -e open' |
||||
fi |
||||
|
||||
@ -1,6 +1,70 @@ |
||||
# hub alias from defunkt |
||||
# https://github.com/defunkt/hub |
||||
if [ "$commands[(I)hub]" ]; then |
||||
# Setup hub function for git, if it is available; http://github.com/defunkt/hub |
||||
if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then |
||||
# 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 |
||||
|
||||
# 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 ############################################################# |
||||
|
||||
|
||||
@ -0,0 +1,80 @@ |
||||
# ------------------------------------------------------------------------------ |
||||
# 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 |
||||
|
||||
@ -0,0 +1,119 @@ |
||||
#!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/ - /\:/" |
||||
############################################################################# |
||||
@ -0,0 +1,54 @@ |
||||
_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 |
||||
@ -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 |
||||
|
||||
@ -0,0 +1,14 @@ |
||||
#---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 |
||||
@ -0,0 +1,4 @@ |
||||
# Aliases |
||||
alias jrspec='jruby --debug -S rspec --debug' |
||||
alias jprofile='jruby --profile.api -S rspec' |
||||
alias jexec='jruby -S' |
||||
@ -0,0 +1,14 @@ |
||||
|
||||
# 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' |
||||
@ -0,0 +1,6 @@ |
||||
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 |
||||
@ -1,19 +0,0 @@ |
||||
#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 "$@" |
||||
@ -0,0 +1 @@ |
||||
eval "$(npm completion 2>/dev/null)" |
||||
@ -0,0 +1,5 @@ |
||||
if [[ -x `which nc` ]]; then |
||||
alias nyan='nc -v miku.acm.uiuc.edu 23' # nyan cat |
||||
fi |
||||
|
||||
|
||||
@ -1,10 +1,66 @@ |
||||
# Thanks to Christopher Sexton |
||||
# https://gist.github.com/965032 |
||||
function kapow { |
||||
touch ~/.pow/$1/tmp/restart.txt |
||||
if [ $? -eq 0 ]; then |
||||
echo "$fg[yellow]Pow restarting $1...$reset_color" |
||||
fi |
||||
# Restart a rack app running under pow |
||||
# http://pow.cx/ |
||||
# |
||||
# Adds a kapow command that will restart an app |
||||
# |
||||
# $ kapow myapp |
||||
# |
||||
# Supports command completion. |
||||
# |
||||
# If you are not already using completion you might need to enable it with |
||||
# |
||||
# autoload -U compinit compinit |
||||
# |
||||
# Changes: |
||||
# |
||||
# Defaults to the current application, and will walk up the tree to find |
||||
# a config.ru file and restart the corresponding app |
||||
# |
||||
# Will Detect if a app does not exist in pow and print a (slightly) helpful |
||||
# error message |
||||
|
||||
rack_root_detect(){ |
||||
setopt chaselinks |
||||
local orgdir=$(pwd) |
||||
local basedir=$(pwd) |
||||
|
||||
while [[ $basedir != '/' ]]; do |
||||
test -e "$basedir/config.ru" && break |
||||
builtin cd ".." 2>/dev/null |
||||
basedir="$(pwd)" |
||||
done |
||||
|
||||
builtin cd $orgdir 2>/dev/null |
||||
[[ ${basedir} == "/" ]] && return 1 |
||||
echo `basename $basedir | sed -E "s/.(com|net|org)//"` |
||||
} |
||||
|
||||
kapow(){ |
||||
local vhost=$1 |
||||
[ ! -n "$vhost" ] && vhost=$(rack_root_detect) |
||||
if [ ! -h ~/.pow/$vhost ] |
||||
then |
||||
echo "pow: This domain isn’t set up yet. Symlink your application to ${vhost} first." |
||||
return 1 |
||||
fi |
||||
|
||||
[ ! -d ~/.pow/${vhost}/tmp ] && mkdir -p ~/.pow/$vhost/tmp |
||||
touch ~/.pow/$vhost/tmp/restart.txt; |
||||
[ $? -eq 0 ] && echo "pow: restarting $vhost.dev" |
||||
} |
||||
compctl -W ~/.pow -/ kapow |
||||
|
||||
powit(){ |
||||
local basedir=$(pwd) |
||||
local vhost=$1 |
||||
[ ! -n "$vhost" ] && vhost=$(rack_root_detect) |
||||
if [ ! -h ~/.pow/$vhost ] |
||||
then |
||||
echo "pow: Symlinking your app with pow. ${vhost}" |
||||
[ ! -d ~/.pow/${vhost} ] && ln -s $basedir ~/.pow/$vhost |
||||
return 1 |
||||
fi |
||||
} |
||||
|
||||
# View the standard out (puts) from any pow app |
||||
alias kaput="tail -f ~/Library/Logs/Pow/apps/*" |
||||
|
||||
@ -0,0 +1,4 @@ |
||||
#compdef powder |
||||
#autoload |
||||
|
||||
compadd `powder help | grep powder | cut -d " " -f 4` |
||||
@ -0,0 +1,8 @@ |
||||
# Find python file |
||||
alias pyfind='find . -name "*.py"' |
||||
|
||||
# Remove python compiled byte-code |
||||
alias pyclean='find . -type f -name "*.py[co]" -delete' |
||||
|
||||
# Grep among .py files |
||||
alias pygrep='grep --include="*.py"' |
||||
@ -0,0 +1,6 @@ |
||||
alias rake="noglob rake" # allows square brackts for rake task invocation |
||||
alias brake='noglob bundle exec rake' # execute the bundled rake gem |
||||
alias srake='noglob sudo rake' # noglob must come before sudo |
||||
alias sbrake='noglob sudo bundle exec rake' # altogether now ... |
||||
|
||||
|
||||
@ -0,0 +1,57 @@ |
||||
_homebrew-installed() { |
||||
type brew &> /dev/null |
||||
} |
||||
|
||||
_rbenv-from-homebrew-installed() { |
||||
brew --prefix rbenv &> /dev/null |
||||
} |
||||
|
||||
FOUND_RBENV=0 |
||||
rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv") |
||||
if _homebrew-installed && _rbenv-from-homebrew-installed ; then |
||||
rbenvdirs=($(brew --prefix rbenv) "${rbenvdirs[@]}") |
||||
fi |
||||
|
||||
for rbenvdir in "${rbenvdirs[@]}" ; do |
||||
if [ -d $rbenvdir/bin -a $FOUND_RBENV -eq 0 ] ; then |
||||
FOUND_RBENV=1 |
||||
export RBENV_ROOT=$rbenvdir |
||||
export PATH=${rbenvdir}/bin:$PATH |
||||
eval "$(rbenv init - zsh)" |
||||
|
||||
alias rubies="rbenv versions" |
||||
alias gemsets="rbenv gemset list" |
||||
|
||||
function current_ruby() { |
||||
echo "$(rbenv version-name)" |
||||
} |
||||
|
||||
function current_gemset() { |
||||
echo "$(rbenv gemset active 2&>/dev/null | sed -e ":a" -e '$ s/\n/+/gp;N;b a' | head -n1)" |
||||
} |
||||
|
||||
function gems { |
||||
local rbenv_path=$(rbenv prefix) |
||||
gem list $@ | sed \ |
||||
-Ee "s/\([0-9\.]+( .+)?\)/$fg[blue]&$reset_color/g" \ |
||||
-Ee "s|$(echo $rbenv_path)|$fg[magenta]\$rbenv_path$reset_color|g" \ |
||||
-Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \ |
||||
-Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g" |
||||
} |
||||
|
||||
function rbenv_prompt_info() { |
||||
if [[ -n $(current_gemset) ]] ; then |
||||
echo "$(current_ruby)@$(current_gemset)" |
||||
else |
||||
echo "$(current_ruby)" |
||||
fi |
||||
} |
||||
fi |
||||
done |
||||
unset rbenvdir |
||||
|
||||
if [ $FOUND_RBENV -eq 0 ] ; then |
||||
alias rubies='ruby -v' |
||||
function gemsets() { echo 'not supported' } |
||||
function rbenv_prompt_info() { echo "system: $(ruby -v | cut -f-2 -d ' ')" } |
||||
fi |
||||
@ -0,0 +1,42 @@ |
||||
# Enables rbfu with --auto option, if available. |
||||
# |
||||
# Also provides a command to list all installed/available |
||||
# rubies. To ensure compatibility with themes, creates the |
||||
# rvm_prompt_info function to return the $RBFU_RUBY_VERSION |
||||
# version. |
||||
|
||||
command -v rbfu &>/dev/null |
||||
|
||||
if [[ $? -eq 0 ]]; then |
||||
eval "$(rbfu --init --auto)" |
||||
|
||||
# Internal: Print ruby version details, if it's currently |
||||
# active etc. |
||||
function _rbfu_rubies_print() { |
||||
local rb rb_out |
||||
rb=$(basename $1) |
||||
rb_out="$rb" |
||||
[[ -h $1 ]] && rb_out="$rb_out${fg[green]}@${reset_color}" |
||||
[[ "x$rb" == "x$2" ]] && rb_out="${fg[red]}$rb_out ${fg[red]}*${reset_color}" |
||||
echo $rb_out |
||||
} |
||||
|
||||
# Public: Provide a list with all available rubies, this basically depends |
||||
# on `ls -1` and .rfbu/rubies. Highlights the currently active ruby version |
||||
# and aliases. |
||||
function rbfu-rubies() { |
||||
local rbfu_dir active_rb |
||||
rbfu_dir=$RBFU_RUBIES |
||||
active_rb=$RBFU_RUBY_VERSION |
||||
[[ -z "$rbfu_dir" ]] && rbfu_dir="${HOME}/.rbfu/rubies" |
||||
[[ -z "$active_rb" ]] && active_rb="system" |
||||
_rbfu_rubies_print "${rbfu_dir}/system" $active_rb |
||||
for rb in $(ls -1 $rbfu_dir); do |
||||
_rbfu_rubies_print "${rbfu_dir}/${rb}" $active_rb |
||||
done |
||||
} |
||||
|
||||
# Public: Create rvm_prompt_info command for themes compatibility, unless |
||||
# it has already been defined. |
||||
[ ! -x rvm_prompt_info ] && function rvm_prompt_info() { echo "${RBFU_RUBY_VERSION:=system}" } |
||||
fi |
||||
@ -0,0 +1,54 @@ |
||||
# if using GNU screen, let the zsh tell screen what the title and hardstatus |
||||
# of the tab window should be. |
||||
if [[ $TERM == "screen" ]]; then |
||||
if [[ $_GET_PATH == '' ]]; then |
||||
_GET_PATH='echo $PWD | sed "s/^\/Users\//~/;s/^\/home\//~/;s/^~$USER/~/"' |
||||
fi |
||||
if [[ $_GET_HOST == '' ]]; then |
||||
_GET_HOST='echo $HOST | sed "s/\..*//"' |
||||
fi |
||||
|
||||
# use the current user as the prefix of the current tab title |
||||
TAB_TITLE_PREFIX='"`'$_GET_HOST'`:`'$_GET_PATH' | sed "s:..*/::"`$PROMPT_CHAR"' |
||||
# when at the shell prompt, show a truncated version of the current path (with |
||||
# standard ~ replacement) as the rest of the title. |
||||
TAB_TITLE_PROMPT='$SHELL:t' |
||||
# when running a command, show the title of the command as the rest of the |
||||
# title (truncate to drop the path to the command) |
||||
TAB_TITLE_EXEC='$cmd[1]:t' |
||||
|
||||
# use the current path (with standard ~ replacement) in square brackets as the |
||||
# prefix of the tab window hardstatus. |
||||
TAB_HARDSTATUS_PREFIX='"[`'$_GET_PATH'`] "' |
||||
# when at the shell prompt, use the shell name (truncated to remove the path to |
||||
# the shell) as the rest of the title |
||||
TAB_HARDSTATUS_PROMPT='$SHELL:t' |
||||
# when running a command, show the command name and arguments as the rest of |
||||
# the title |
||||
TAB_HARDSTATUS_EXEC='$cmd' |
||||
|
||||
# tell GNU screen what the tab window title ($1) and the hardstatus($2) should be |
||||
function screen_set() |
||||
{ |
||||
# set the tab window title (%t) for screen |
||||
print -nR $'\033k'$1$'\033'\\\ |
||||
|
||||
# set hardstatus of tab window (%h) for screen |
||||
print -nR $'\033]0;'$2$'\a' |
||||
} |
||||
# called by zsh before executing a command |
||||
function preexec() |
||||
{ |
||||
local -a cmd; cmd=(${(z)1}) # the command string |
||||
eval "tab_title=$TAB_TITLE_PREFIX:$TAB_TITLE_EXEC" |
||||
eval "tab_hardstatus=$TAB_HARDSTATUS_PREFIX:$TAB_HARDSTATUS_EXEC" |
||||
screen_set $tab_title $tab_hardstatus |
||||
} |
||||
# called by zsh before showing the prompt |
||||
function precmd() |
||||
{ |
||||
eval "tab_title=$TAB_TITLE_PREFIX:$TAB_TITLE_PROMPT" |
||||
eval "tab_hardstatus=$TAB_HARDSTATUS_PREFIX:$TAB_HARDSTATUS_PROMPT" |
||||
screen_set $tab_title $tab_hardstatus |
||||
} |
||||
fi |
||||
@ -0,0 +1,64 @@ |
||||
# Contributed and SLIGHTLY modded by Matt Parnell/ilikenwf <parwok -at- gmail> |
||||
# Created by the blogger at the URL below...I don't know where to find his/her name |
||||
# Original found at http://www.shellperson.net/sprunge-pastebin-script/ |
||||
|
||||
usage() { |
||||
description | fmt -s >&2 |
||||
} |
||||
|
||||
description() { |
||||
cat << HERE |
||||
|
||||
DESCRIPTION |
||||
Upload data and fetch URL from the pastebin http://sprunge.us |
||||
|
||||
USAGE |
||||
$0 filename.txt |
||||
$0 text string |
||||
$0 < filename.txt |
||||
piped_data | $0 |
||||
|
||||
NOTES |
||||
-------------------------------------------------------------------------- |
||||
* INPUT METHODS * |
||||
$0 can accept piped data, STDIN redirection [<filename.txt], text strings following the command as arguments, or filenames as arguments. Only one of these methods can be used at a time, so please see the note on precedence. Also, note that using a pipe or STDIN redirection will treat tabs as spaces, or disregard them entirely (if they appear at the beginning of a line). So I suggest using a filename as an argument if tabs are important either to the function or readability of the code. |
||||
|
||||
* PRECEDENCE * |
||||
STDIN redirection has precedence, then piped input, then a filename as an argument, and finally text strings as an arguments. |
||||
|
||||
EXAMPLE: |
||||
echo piped | "$0" arguments.txt < stdin_redirection.txt |
||||
|
||||
In this example, the contents of file_as_stdin_redirection.txt would be uploaded. Both the piped_text and the file_as_argument.txt are ignored. If there is piped input and arguments, the arguments will be ignored, and the piped input uploaded. |
||||
|
||||
* FILENAMES * |
||||
If a filename is misspelled or doesn't have the necessary path description, it will NOT generate an error, but will instead treat it as a text string and upload it. |
||||
-------------------------------------------------------------------------- |
||||
|
||||
HERE |
||||
exit |
||||
} |
||||
|
||||
sprunge() { |
||||
if [ -t 0 ]; then |
||||
echo Running interactively, checking for arguments... >&2 |
||||
if [ "$*" ]; then |
||||
echo Arguments present... >&2 |
||||
if [ -f "$*" ]; then |
||||
echo Uploading the contents of "$*"... >&2 |
||||
cat "$*" |
||||
else |
||||
echo Uploading the text: \""$*"\"... >&2 |
||||
echo "$*" |
||||
fi | curl -F 'sprunge=<-' http://sprunge.us |
||||
else |
||||
echo No arguments found, printing USAGE and exiting. >&2 |
||||
usage |
||||
fi |
||||
else |
||||
echo Using input from a pipe or STDIN redirection... >&2 |
||||
while read -r line ; do |
||||
echo $line |
||||
done | curl -F 'sprunge=<-' http://sprunge.us |
||||
fi |
||||
} |
||||
@ -0,0 +1,9 @@ |
||||
# Sublime Text 2 Aliases |
||||
#unamestr = 'uname' |
||||
|
||||
if [[ $('uname') == 'Linux' ]]; then |
||||
alias st='/usr/bin/sublime_text&' |
||||
elif [[ $('uname') == 'Darwin' ]]; then |
||||
alias st='/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl' |
||||
fi |
||||
alias stt='st .' |
||||
@ -0,0 +1,7 @@ |
||||
alias zi='sudo zypper install' |
||||
alias zrf='sudo zypper refresh' |
||||
alias zs='zypper search' |
||||
alias zup='sudo zypper dist-upgrade' |
||||
alias zrm='sudo zypper remove' |
||||
alias zp='sudo zypper patch' |
||||
alias zps='sudo zypper ps' |
||||
@ -0,0 +1,13 @@ |
||||
# Symfony2 basic command completion |
||||
|
||||
_symfony2_get_command_list () { |
||||
app/console --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }' |
||||
} |
||||
|
||||
_symfony2 () { |
||||
if [ -f app/console ]; then |
||||
compadd `_symfony2_get_command_list` |
||||
fi |
||||
} |
||||
|
||||
compdef _symfony2 app/console |
||||
@ -0,0 +1,11 @@ |
||||
# Set Apple Terminal.app resume directory |
||||
# based on this answer: http://superuser.com/a/315029 |
||||
|
||||
function chpwd { |
||||
local SEARCH=' ' |
||||
local REPLACE='%20' |
||||
local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}" |
||||
printf '\e]7;%s\a' "$PWD_URL" |
||||
} |
||||
|
||||
chpwd |
||||
@ -0,0 +1,38 @@ |
||||
#compdef terminitor |
||||
#autoload |
||||
|
||||
# terminitor zsh completion |
||||
|
||||
_terminitor_available_scripts() { |
||||
scripts=(`for SCRIPT in ~/.config/terminitor/*.term ; do basename $SCRIPT .term ; done`) |
||||
} |
||||
|
||||
local -a _1st_arguments |
||||
_1st_arguments=( |
||||
'create:create a Termfile in directory' |
||||
'delete:delete terminitor script' |
||||
'edit:open termitor script' |
||||
'fetch:clone the designated repo and run setup' |
||||
'help:Describe available tasks or one specific task' |
||||
'init:create initial root terminitor folder' |
||||
'list:lists all terminitor scripts' |
||||
'setup:execute setup in the terminitor script' |
||||
'start:runs the terminitor script' |
||||
'update:update Terminitor to new global path(.config/.terminitor)' |
||||
) |
||||
|
||||
local expl |
||||
|
||||
_arguments \ |
||||
'*:: :->subcmds' && return 0 |
||||
|
||||
if (( CURRENT == 1 )); then |
||||
_describe -t commands "terminitor task" _1st_arguments |
||||
return |
||||
fi |
||||
|
||||
case "$words[1]" in |
||||
start|edit|delete|setup) |
||||
_terminitor_available_scripts |
||||
_wanted scripts expl 'installed scripts' compadd -a scripts ;; |
||||
esac |
||||
@ -0,0 +1,46 @@ |
||||
WRAPPER_FOUND=0 |
||||
for wrapsource in "/usr/bin/virtualenvwrapper.sh" "/usr/local/bin/virtualenvwrapper.sh" "/etc/bash_completion.d/virtualenvwrapper" ; do |
||||
if [[ -e $wrapsource ]] ; then |
||||
WRAPPER_FOUND=1 |
||||
source $wrapsource |
||||
|
||||
if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then |
||||
# Automatically activate Git projects' virtual environments based on the |
||||
# directory name of the project. Virtual environment name can be overridden |
||||
# by placing a .venv file in the project root with a virtualenv name in it |
||||
function workon_cwd { |
||||
# Check that this is a Git repo |
||||
PROJECT_ROOT=`git rev-parse --show-toplevel 2> /dev/null` |
||||
if (( $? == 0 )); then |
||||
# Check for virtualenv name override |
||||
ENV_NAME=`basename "$PROJECT_ROOT"` |
||||
if [[ -f "$PROJECT_ROOT/.venv" ]]; then |
||||
ENV_NAME=`cat "$PROJECT_ROOT/.venv"` |
||||
fi |
||||
# Activate the environment only if it is not already active |
||||
if [[ "$VIRTUAL_ENV" != "$WORKON_HOME/$ENV_NAME" ]]; then |
||||
if [[ -e "$WORKON_HOME/$ENV_NAME/bin/activate" ]]; then |
||||
workon "$ENV_NAME" && export CD_VIRTUAL_ENV="$ENV_NAME" |
||||
fi |
||||
fi |
||||
elif [ $CD_VIRTUAL_ENV ]; then |
||||
# We've just left the repo, deactivate the environment |
||||
# Note: this only happens if the virtualenv was activated automatically |
||||
deactivate && unset CD_VIRTUAL_ENV |
||||
fi |
||||
unset PROJECT_ROOT |
||||
} |
||||
|
||||
# New cd function that does the virtualenv magic |
||||
function cd { |
||||
builtin cd "$@" && workon_cwd |
||||
} |
||||
fi |
||||
|
||||
break |
||||
fi |
||||
done |
||||
|
||||
if [ $WRAPPER_FOUND -eq 0 ] ; then |
||||
print "zsh virtualenvwrapper plugin: Couldn't activate virtualenvwrapper. Please run \`pip install virtualenvwrapper\`." |
||||
fi |
||||
@ -0,0 +1,23 @@ |
||||
function vundle-init () { |
||||
if [ ! -d ~/.vim/bundle/vundle/ ] |
||||
then |
||||
mkdir -p ~/.vim/bundle/vundle/ |
||||
fi |
||||
|
||||
if [ ! -d ~/.vim/bundle/vundle/.git/ ] |
||||
then |
||||
git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle |
||||
echo "\n\tRead about vim configuration for vundle at https://github.com/gmarik/vundle\n" |
||||
fi |
||||
} |
||||
|
||||
function vundle () { |
||||
vundle-init |
||||
vim -c "execute \"BundleInstall\" | q | q" |
||||
} |
||||
|
||||
|
||||
function vundle-update () { |
||||
vundle-init |
||||
vim -c "execute \"BundleInstall!\" | q | q" |
||||
} |
||||
@ -0,0 +1,29 @@ |
||||
This plugin provides a wrapper around the "wakeonlan" tool available from most |
||||
distributions' package repositories, or from the following website: |
||||
|
||||
http://gsd.di.uminho.pt/jpo/software/wakeonlan/ |
||||
|
||||
In order to use this wrapper, create the ~/.wakeonlan directory, and place in |
||||
that directory one file for each device you would like to be able to wake. Give |
||||
the file a name that describes the device, such as its hostname. Each file |
||||
should contain a line with the mac address of the target device and the network |
||||
broadcast address. |
||||
|
||||
For instance, there might be a file ~/.wakeonlan/leto with the following |
||||
contents: |
||||
|
||||
00:11:22:33:44:55:66 192.168.0.255 |
||||
|
||||
To wake that device, use the following command: |
||||
|
||||
# wake leto |
||||
|
||||
The available device names will be autocompleted, so: |
||||
|
||||
# wake <tab> |
||||
|
||||
...will suggest "leto", along with any other configuration files that were |
||||
placed in the ~/.wakeonlan directory. |
||||
|
||||
For more information regarding the configuration file format, check the |
||||
wakeonlan man page. |
||||
@ -0,0 +1,4 @@ |
||||
#compdef wake |
||||
#autoload |
||||
|
||||
_arguments "1:device to wake:_files -W '$HOME/.wakeonlan'" && return 0 |
||||
@ -0,0 +1,14 @@ |
||||
function wake() { |
||||
local config_file="$HOME/.wakeonlan/$1" |
||||
if [[ ! -f "$config_file" ]]; then |
||||
echo "ERROR: There is no configuration file at \"$config_file\"." |
||||
return 1 |
||||
fi |
||||
|
||||
if (( ! $+commands[wakeonlan] )); then |
||||
echo "ERROR: Can't find \"wakeonlan\". Are you sure it's installed?" |
||||
return 1 |
||||
fi |
||||
|
||||
wakeonlan -f "$config_file" |
||||
} |
||||
@ -0,0 +1,36 @@ |
||||
# af-magic.zsh-theme |
||||
# |
||||
# Author: Andy Fleming |
||||
# URL: http://andyfleming.com/ |
||||
# Repo: https://github.com/andyfleming/oh-my-zsh |
||||
# Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme |
||||
# |
||||
# Created on: June 19, 2012 |
||||
# Last modified on: June 20, 2012 |
||||
|
||||
|
||||
|
||||
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi |
||||
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" |
||||
|
||||
# primary prompt |
||||
PROMPT='$FG[237]------------------------------------------------------------%{$reset_color%} |
||||
$FG[032]%~\ |
||||
$(git_prompt_info) \ |
||||
$FG[105]%(!.#.»)%{$reset_color%} ' |
||||
PROMPT2='%{$fg[red]%}\ %{$reset_color%}' |
||||
RPS1='${return_code}' |
||||
|
||||
|
||||
# color vars |
||||
eval my_gray='$FG[237]' |
||||
eval my_orange='$FG[214]' |
||||
|
||||
# right prompt |
||||
RPROMPT='$my_gray%n@%m%{$reset_color%}%' |
||||
|
||||
# git settings |
||||
ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075](branch:" |
||||
ZSH_THEME_GIT_PROMPT_CLEAN="" |
||||
ZSH_THEME_GIT_PROMPT_DIRTY="$my_orange*%{$reset_color%}" |
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="$FG[075])%{$reset_color%}" |
||||
@ -0,0 +1,43 @@ |
||||
# CRUNCH - created from Steve Eley's cat waxing. |
||||
# Initially hacked from the Dallas theme. Thanks, Dallas Reedy. |
||||
# |
||||
# This theme assumes you do most of your oh-my-zsh'ed "colorful" work at a single machine, |
||||
# and eschews the standard space-consuming user and hostname info. Instead, only the |
||||
# things that vary in my own workflow are shown: |
||||
# |
||||
# * The time (not the date) |
||||
# * The RVM version and gemset (omitting the 'ruby' name if it's MRI) |
||||
# * The current directory |
||||
# * The Git branch and its 'dirty' state |
||||
# |
||||
# Colors are at the top so you can mess with those separately if you like. |
||||
# For the most part I stuck with Dallas's. |
||||
|
||||
CRUNCH_BRACKET_COLOR="%{$fg[white]%}" |
||||
CRUNCH_TIME_COLOR="%{$fg[yellow]%}" |
||||
CRUNCH_RVM_COLOR="%{$fg[magenta]%}" |
||||
CRUNCH_DIR_COLOR="%{$fg[cyan]%}" |
||||
CRUNCH_GIT_BRANCH_COLOR="%{$fg[green]%}" |
||||
CRUNCH_GIT_CLEAN_COLOR="%{$fg[green]%}" |
||||
CRUNCH_GIT_DIRTY_COLOR="%{$fg[red]%}" |
||||
|
||||
# These Git variables are used by the oh-my-zsh git_prompt_info helper: |
||||
ZSH_THEME_GIT_PROMPT_PREFIX="$CRUNCH_BRACKET_COLOR:$CRUNCH_GIT_BRANCH_COLOR" |
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="" |
||||
ZSH_THEME_GIT_PROMPT_CLEAN=" $CRUNCH_GIT_CLEAN_COLOR✓" |
||||
ZSH_THEME_GIT_PROMPT_DIRTY=" $CRUNCH_GIT_DIRTY_COLOR✗" |
||||
|
||||
# Our elements: |
||||
CRUNCH_TIME_="$CRUNCH_BRACKET_COLOR{$CRUNCH_TIME_COLOR%T$CRUNCH_BRACKET_COLOR}%{$reset_color%}" |
||||
if which rvm-prompt &> /dev/null; then |
||||
CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(~/.rvm/bin/rvm-prompt i v g)#ruby-}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}" |
||||
else |
||||
if which rbenv &> /dev/null; then |
||||
CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(rbenv version | sed -e 's/ (set.*$//' -e 's/^ruby-//')}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}" |
||||
fi |
||||
fi |
||||
CRUNCH_DIR_="$CRUNCH_DIR_COLOR%~\$(git_prompt_info) " |
||||
CRUNCH_PROMPT="$CRUNCH_BRACKET_COLOR➭ " |
||||
|
||||
# Put it all together! |
||||
PROMPT="$CRUNCH_TIME_$CRUNCH_RVM_$CRUNCH_DIR_$CRUNCH_PROMPT%{$reset_color%}" |
||||
@ -0,0 +1,39 @@ |
||||
# Fino-time theme by Aexander Berezovsky (http://berezovsky.me) based on Fino by Max Masnick (http://max.masnick.me) |
||||
|
||||
# Use with a dark background and 256-color terminal! |
||||
# Meant for people with RVM and git. Tested only on OS X 10.7. |
||||
|
||||
# You can set your computer name in the ~/.box-name file if you want. |
||||
|
||||
# Borrowing shamelessly from these oh-my-zsh themes: |
||||
# bira |
||||
# robbyrussell |
||||
# |
||||
# Also borrowing from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/ |
||||
|
||||
function virtualenv_info { |
||||
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' |
||||
} |
||||
|
||||
function prompt_char { |
||||
git branch >/dev/null 2>/dev/null && echo '±' && return |
||||
echo '○' |
||||
} |
||||
|
||||
function box_name { |
||||
[ -f ~/.box-name ] && cat ~/.box-name || hostname -s |
||||
} |
||||
|
||||
|
||||
local rvm_ruby='‹$(rvm-prompt i v g)›%{$reset_color%}' |
||||
local current_dir='${PWD/#$HOME/~}' |
||||
local git_info='$(git_prompt_info)' |
||||
|
||||
|
||||
PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info} %{$FG[239]%}using%{$FG[243]%} ${rvm_ruby} %D - %* |
||||
╰─$(virtualenv_info)$(prompt_char) " |
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}" |
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" |
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[202]%}✘✘✘" |
||||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔" |
||||
@ -0,0 +1,46 @@ |
||||
# Fino theme by Max Masnick (http://max.masnick.me) |
||||
|
||||
# Use with a dark background and 256-color terminal! |
||||
# Meant for people with RVM and git. Tested only on OS X 10.7. |
||||
|
||||
# You can set your computer name in the ~/.box-name file if you want. |
||||
|
||||
# Borrowing shamelessly from these oh-my-zsh themes: |
||||
# bira |
||||
# robbyrussell |
||||
# |
||||
# Also borrowing from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/ |
||||
|
||||
function virtualenv_info { |
||||
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' |
||||
} |
||||
|
||||
function prompt_char { |
||||
git branch >/dev/null 2>/dev/null && echo '±' && return |
||||
echo '○' |
||||
} |
||||
|
||||
function box_name { |
||||
[ -f ~/.box-name ] && cat ~/.box-name || hostname -s |
||||
} |
||||
|
||||
|
||||
local rvm_ruby='' |
||||
if which rvm-prompt &> /dev/null; then |
||||
rvm_ruby='‹$(rvm-prompt i v g)›%{$reset_color%}' |
||||
else |
||||
if which rbenv &> /dev/null; then |
||||
rvm_ruby='‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}' |
||||
fi |
||||
fi |
||||
local current_dir='${PWD/#$HOME/~}' |
||||
local git_info='$(git_prompt_info)' |
||||
|
||||
|
||||
PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info} %{$FG[239]%}using%{$FG[243]%} ${rvm_ruby} |
||||
╰─$(virtualenv_info)$(prompt_char) " |
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}" |
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" |
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[202]%}✘✘✘" |
||||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔" |
||||
@ -0,0 +1,8 @@ |
||||
#fox theme |
||||
PROMPT='%{$fg[cyan]%}┌[%{$fg_bold[white]%}%n%{$reset_color%}%{$fg[cyan]%}☮%{$fg_bold[white]%}%M%{$reset_color%}%{$fg[cyan]%}]%{$fg[white]%}-%{$fg[cyan]%}(%{$fg_bold[white]%}%~%{$reset_color%}%{$fg[cyan]%})$(git_prompt_info) |
||||
└> % %{$reset_color%}' |
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="-[%{$reset_color%}%{$fg[white]%}git://%{$fg_bold[white]%}" |
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}%{$fg[cyan]%}]-" |
||||
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}✗%{$reset_color%}" |
||||
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%{$reset_color%}" |
||||
@ -0,0 +1,54 @@ |
||||
# ZSH Theme - Preview: http://dl.dropbox.com/u/4109351/pics/gnzh-zsh-theme.png |
||||
# Based on bira theme |
||||
|
||||
# load some modules |
||||
autoload -U colors zsh/terminfo # Used in the colour alias below |
||||
colors |
||||
setopt prompt_subst |
||||
|
||||
# make some aliases for the colours: (coud use normal escap.seq's too) |
||||
for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do |
||||
eval PR_$color='%{$fg[${(L)color}]%}' |
||||
done |
||||
eval PR_NO_COLOR="%{$terminfo[sgr0]%}" |
||||
eval PR_BOLD="%{$terminfo[bold]%}" |
||||
|
||||
# Check the UID |
||||
if [[ $UID -ge 1000 ]]; then # normal user |
||||
eval PR_USER='${PR_GREEN}%n${PR_NO_COLOR}' |
||||
eval PR_USER_OP='${PR_GREEN}%#${PR_NO_COLOR}' |
||||
local PR_PROMPT='$PR_NO_COLOR➤ $PR_NO_COLOR' |
||||
elif [[ $UID -eq 0 ]]; then # root |
||||
eval PR_USER='${PR_RED}%n${PR_NO_COLOR}' |
||||
eval PR_USER_OP='${PR_RED}%#${PR_NO_COLOR}' |
||||
local PR_PROMPT='$PR_RED➤ $PR_NO_COLOR' |
||||
fi |
||||
|
||||
# Check if we are on SSH or not |
||||
if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then |
||||
eval PR_HOST='${PR_YELLOW}%M${PR_NO_COLOR}' #SSH |
||||
else |
||||
eval PR_HOST='${PR_GREEN}%M${PR_NO_COLOR}' # no SSH |
||||
fi |
||||
|
||||
local return_code="%(?..%{$PR_RED%}%? ↵%{$PR_NO_COLOR%})" |
||||
|
||||
local user_host='${PR_USER}${PR_CYAN}@${PR_HOST}' |
||||
local current_dir='%{$PR_BOLD$PR_BLUE%}%~%{$PR_NO_COLOR%}' |
||||
local rvm_ruby='' |
||||
if which rvm-prompt &> /dev/null; then |
||||
rvm_ruby='%{$PR_RED%}‹$(rvm-prompt i v g s)›%{$PR_NO_COLOR%}' |
||||
else |
||||
if which rbenv &> /dev/null; then |
||||
rvm_ruby='%{$PR_RED%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$PR_NO_COLOR%}' |
||||
fi |
||||
fi |
||||
local git_branch='$(git_prompt_info)%{$PR_NO_COLOR%}' |
||||
|
||||
#PROMPT="${user_host} ${current_dir} ${rvm_ruby} ${git_branch}$PR_PROMPT " |
||||
PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch} |
||||
╰─$PR_PROMPT " |
||||
RPS1="${return_code}" |
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$PR_YELLOW%}‹" |
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$PR_NO_COLOR%}" |
||||
@ -0,0 +1,24 @@ |
||||
# mh theme |
||||
# preview: http://cl.ly/1y2x0W0E3t2C0F29043z |
||||
|
||||
# features: |
||||
# path is autoshortened to ~30 characters |
||||
# displays git status (if applicable in current folder) |
||||
# turns username green if superuser, otherwise it is white |
||||
|
||||
# if superuser make the username green |
||||
if [ $UID -eq 0 ]; then NCOLOR="green"; else NCOLOR="white"; fi |
||||
|
||||
# prompt |
||||
PROMPT='[%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[red]%}%30<...<%~%<<%{$reset_color%}]%(!.#.$) ' |
||||
RPROMPT='$(git_prompt_info)' |
||||
|
||||
# git theming |
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[gray]%}(%{$fg_no_bold[yellow]%}%B" |
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[gray]%})%{$reset_color%} " |
||||
ZSH_THEME_GIT_PROMPT_CLEAN="" |
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✱" |
||||
|
||||
# LS colors, made with http://geoff.greer.fm/lscolors/ |
||||
export LSCOLORS="Gxfxcxdxbxegedabagacad" |
||||
export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' |
||||
@ -0,0 +1,58 @@ |
||||
function my_git_prompt() { |
||||
tester=$(git rev-parse --git-dir 2> /dev/null) || return |
||||
|
||||
INDEX=$(git status --porcelain 2> /dev/null) |
||||
STATUS="" |
||||
|
||||
# is branch ahead? |
||||
if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then |
||||
STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_AHEAD" |
||||
fi |
||||
|
||||
# is anything staged? |
||||
if $(echo "$INDEX" | grep -E -e '^(D[ M]|[MARC][ MD]) ' &> /dev/null); then |
||||
STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_STAGED" |
||||
fi |
||||
|
||||
# is anything unstaged? |
||||
if $(echo "$INDEX" | grep -E -e '^[ MARC][MD] ' &> /dev/null); then |
||||
STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_UNSTAGED" |
||||
fi |
||||
|
||||
# is anything untracked? |
||||
if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then |
||||
STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_UNTRACKED" |
||||
fi |
||||
|
||||
# is anything unmerged? |
||||
if $(echo "$INDEX" | grep -E -e '^(A[AU]|D[DU]|U[ADU]) ' &> /dev/null); then |
||||
STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_UNMERGED" |
||||
fi |
||||
|
||||
if [[ -n $STATUS ]]; then |
||||
STATUS=" $STATUS" |
||||
fi |
||||
|
||||
echo "$ZSH_THEME_GIT_PROMPT_PREFIX$(my_current_branch)$STATUS$ZSH_THEME_GIT_PROMPT_SUFFIX" |
||||
} |
||||
|
||||
function my_current_branch() { |
||||
echo $(current_branch || echo "(no branch)") |
||||
} |
||||
|
||||
function ssh_connection() { |
||||
if [[ -n $SSH_CONNECTION ]]; then |
||||
echo "%{$fg_bold[red]%}(ssh) " |
||||
fi |
||||
} |
||||
|
||||
PROMPT=$'\n$(ssh_connection)%{$fg_bold[green]%}%n@%m%{$reset_color%}$(my_git_prompt) : %~\n%# ' |
||||
|
||||
ZSH_THEME_PROMPT_RETURNCODE_PREFIX="%{$fg_bold[red]%}" |
||||
ZSH_THEME_GIT_PROMPT_PREFIX=" $fg[white]‹ %{$fg_bold[yellow]%}" |
||||
ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg_bold[magenta]%}↑" |
||||
ZSH_THEME_GIT_PROMPT_STAGED="%{$fg_bold[green]%}●" |
||||
ZSH_THEME_GIT_PROMPT_UNSTAGED="%{$fg_bold[red]%}●" |
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[white]%}●" |
||||
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[red]%}✕" |
||||
ZSH_THEME_GIT_PROMPT_SUFFIX=" $fg_bold[white]›%{$reset_color%}" |
||||
@ -0,0 +1,4 @@ |
||||
PROMPT='%{$fg[yellow]%}λ %{$fg[green]%}%c %{$fg[yellow]%}→ $(git_prompt_info)%{$reset_color%}' |
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="λ %{$fg[blue]%}git %{$fg[red]%}" |
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%} → %{$reset_color%}" |
||||
@ -0,0 +1,9 @@ |
||||
# Yay! High voltage and arrows! |
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" |
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " |
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}" |
||||
ZSH_THEME_GIT_PROMPT_CLEAN="" |
||||
|
||||
PROMPT='%{$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}$(git_prompt_info)%{$fg[cyan]%}⇒%{$reset_color%} ' |
||||
|
||||
@ -0,0 +1,29 @@ |
||||
# user, host, full path, and time/date |
||||
# on two lines for easier vgrepping |
||||
# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 |
||||
|
||||
function hg_prompt_info { |
||||
hg prompt --angle-brackets "\ |
||||
<hg:%{$fg[magenta]%}<branch>%{$reset_color%}>\ |
||||
</%{$fg[yellow]%}<tags|%{$reset_color%}, %{$fg[yellow]%}>%{$reset_color%}>\ |
||||
%{$fg[red]%}<status|modified|unknown><update>%{$reset_color%}< |
||||
patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null |
||||
} |
||||
|
||||
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%}+" |
||||
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}✱" |
||||
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}✗" |
||||
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}➦" |
||||
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%}✂" |
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%}✈" |
||||
|
||||
function mygit() { |
||||
ref=$(git symbolic-ref HEAD 2> /dev/null) || return |
||||
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$( git_prompt_status )%{$reset_color%}$ZSH_THEME_GIT_PROMPT_SUFFIX" |
||||
} |
||||
|
||||
# alternate prompt with git & hg |
||||
PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} |
||||
%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <$(mygit)$(hg_prompt_info)>%{\e[0m%}%b ' |
||||
PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' |
||||
|
||||
@ -0,0 +1,8 @@ |
||||
# user, host, full path, and time/date |
||||
# on two lines for easier vgrepping |
||||
# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 |
||||
|
||||
PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} |
||||
%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B]%{\e[0m%}%b ' |
||||
|
||||
|
||||
@ -0,0 +1,6 @@ |
||||
PROMPT='%{$fg[white]%}%c$(git_prompt_info)$ % %{$reset_color%}' |
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="(" |
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="" |
||||
ZSH_THEME_GIT_PROMPT_DIRTY="*)" |
||||
ZSH_THEME_GIT_PROMPT_CLEAN=")" |
||||
@ -0,0 +1,30 @@ |
||||
function prompt_char { |
||||
git branch >/dev/null 2>/dev/null && echo '±' && return |
||||
hg root >/dev/null 2>/dev/null && echo 'Hg' && return |
||||
echo '○' |
||||
} |
||||
|
||||
function virtualenv_info { |
||||
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' |
||||
} |
||||
|
||||
function collapse_pwd { |
||||
echo $(pwd | sed -e "s,^$HOME,~,") |
||||
} |
||||
|
||||
if which rvm-prompt &> /dev/null; then |
||||
PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) using %{$reset_color%}%{$fg[red]%}$(~/.rvm/bin/rvm-prompt)%{$reset_color%} |
||||
$(virtualenv_info)$(prompt_char) ' |
||||
else |
||||
if which rbenv &> /dev/null; then |
||||
PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) using %{$reset_color%}%{$fg[red]%}$(rbenv version | sed -e "s/ (set.*$//")%{$reset_color%} |
||||
$(virtualenv_info)$(prompt_char) ' |
||||
fi |
||||
fi |
||||
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" |
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" |
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!" |
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" |
||||
ZSH_THEME_GIT_PROMPT_CLEAN="" |
||||
@ -0,0 +1,5 @@ |
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}[" |
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} " |
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%} x%{$fg_bold[blue]%}" |
||||
|
||||
PROMPT='%{$(git_prompt_info)%}%{$fg_bold[green]%}{%{$(rvm current 2>/dev/null || rbenv version-name 2>/dev/null)%}}%{$reset_color%} %{$fg[cyan]%}%c%{$reset_color%} ' |
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue