Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updates

  • Loading branch information...
commit 5e8845fe8c304bbf628179b5768c3d6573c14221 1 parent 479bdc1
@plukevdh authored
Showing with 1,909 additions and 589 deletions.
  1. +3 −3 home/.oh-my-zsh/.gitignore
  2. +23 −10 home/.oh-my-zsh/README.textile
  3. +0 −1  home/.oh-my-zsh/custom/aliases.zsh
  4. +14 −2 home/.oh-my-zsh/lib/aliases.zsh
  5. +4 −1 home/.oh-my-zsh/lib/completion.zsh
  6. +5 −2 home/.oh-my-zsh/lib/correction.zsh
  7. +14 −15 home/.oh-my-zsh/lib/directories.zsh
  8. +0 −3  home/.oh-my-zsh/lib/edit-command-line.zsh
  9. +59 −1 home/.oh-my-zsh/lib/functions.zsh
  10. +61 −14 home/.oh-my-zsh/lib/git.zsh
  11. +3 −1 home/.oh-my-zsh/lib/history.zsh
  12. +5 −0 home/.oh-my-zsh/lib/key-bindings.zsh
  13. +3 −1 home/.oh-my-zsh/lib/misc.zsh
  14. +6 −3 home/.oh-my-zsh/lib/rvm.zsh
  15. +7 −0 home/.oh-my-zsh/lib/spectrum.zsh
  16. +5 −3 home/.oh-my-zsh/lib/termsupport.zsh
  17. +11 −1 home/.oh-my-zsh/lib/theme-and-appearance.zsh
  18. +26 −13 home/.oh-my-zsh/oh-my-zsh.sh
  19. +3 −13 home/.oh-my-zsh/plugins/ant/ant.plugin.zsh
  20. +21 −3 home/.oh-my-zsh/plugins/archlinux/archlinux.plugin.zsh
  21. +8 −2 home/.oh-my-zsh/plugins/autojump/autojump.plugin.zsh
  22. +86 −14 home/.oh-my-zsh/plugins/battery/battery.plugin.zsh
  23. +5 −2 home/.oh-my-zsh/plugins/brew/_brew
  24. +9 −0 home/.oh-my-zsh/plugins/bundler/_bundler
  25. +28 −2 home/.oh-my-zsh/plugins/bundler/bundler.plugin.zsh
  26. +4 −7 home/.oh-my-zsh/plugins/cake/cake.plugin.zsh
  27. +5 −1 home/.oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh
  28. +21 −2 home/.oh-my-zsh/plugins/composer/composer.plugin.zsh
  29. +42 −7 home/.oh-my-zsh/plugins/debian/debian.plugin.zsh
  30. +15 −0 home/.oh-my-zsh/plugins/django/django.plugin.zsh
  31. +3 −1 home/.oh-my-zsh/plugins/encode64/encode64.plugin.zsh
  32. +2 −2 home/.oh-my-zsh/plugins/extract/extract.plugin.zsh
  33. +6 −1 home/.oh-my-zsh/plugins/fasd/fasd.plugin.zsh
  34. +7 −4 home/.oh-my-zsh/plugins/gem/_gem
  35. +24 −5 home/.oh-my-zsh/plugins/git-flow/git-flow.plugin.zsh
  36. +98 −7 home/.oh-my-zsh/plugins/git/git.plugin.zsh
  37. +18 −0 home/.oh-my-zsh/plugins/github/github.plugin.zsh
  38. +33 −18 home/.oh-my-zsh/plugins/gpg-agent/gpg-agent.plugin.zsh
  39. +3 −16 home/.oh-my-zsh/plugins/gradle/gradle.plugin.zsh
  40. +17 −11 home/.oh-my-zsh/plugins/grails/grails.plugin.zsh
  41. +5 −2 home/.oh-my-zsh/plugins/heroku/_heroku
  42. +32 −9 home/.oh-my-zsh/plugins/jira/jira.plugin.zsh
  43. +21 −4 home/.oh-my-zsh/plugins/knife/_knife
  44. +14 −0 home/.oh-my-zsh/plugins/lein/lein.plugin.zsh
  45. +1 −0  home/.oh-my-zsh/plugins/lol/lol.plugin.zsh
  46. +51 −1 home/.oh-my-zsh/plugins/mercurial/mercurial.plugin.zsh
  47. +169 −3 home/.oh-my-zsh/plugins/mvn/mvn.plugin.zsh
  48. +9 −1 home/.oh-my-zsh/plugins/node/node.plugin.zsh
  49. +97 −3 home/.oh-my-zsh/plugins/osx/osx.plugin.zsh
  50. +4 −3 home/.oh-my-zsh/plugins/per-directory-history/per-directory-history.plugin.zsh
  51. +4 −7 home/.oh-my-zsh/plugins/phing/phing.plugin.zsh
  52. +8 −3 home/.oh-my-zsh/plugins/pip/_pip
  53. +8 −2 home/.oh-my-zsh/plugins/python/python.plugin.zsh
  54. +59 −2 home/.oh-my-zsh/plugins/rails/rails.plugin.zsh
  55. +4 −23 home/.oh-my-zsh/plugins/rails3/rails3.plugin.zsh
  56. +6 −6 home/.oh-my-zsh/plugins/rbenv/rbenv.plugin.zsh
  57. +21 −3 home/.oh-my-zsh/plugins/rvm/rvm.plugin.zsh
  58. +1 −1  home/.oh-my-zsh/plugins/screen/screen.plugin.zsh
  59. +1 −3 home/.oh-my-zsh/plugins/sprunge/sprunge.plugin.zsh
  60. +14 −5 home/.oh-my-zsh/plugins/ssh-agent/ssh-agent.plugin.zsh
  61. +27 −3 home/.oh-my-zsh/plugins/sublime/sublime.plugin.zsh
  62. +1 −0  home/.oh-my-zsh/plugins/supervisor/_supervisord
  63. +61 −7 home/.oh-my-zsh/plugins/suse/suse.plugin.zsh
  64. +61 −27 home/.oh-my-zsh/plugins/svn/svn.plugin.zsh
  65. +7 −3 home/.oh-my-zsh/plugins/symfony2/symfony2.plugin.zsh
  66. +35 −7 home/.oh-my-zsh/plugins/terminalapp/terminalapp.plugin.zsh
  67. +11 −2 home/.oh-my-zsh/plugins/textmate/textmate.plugin.zsh
  68. +32 −2 home/.oh-my-zsh/plugins/urltools/urltools.plugin.zsh
  69. +11 −3 home/.oh-my-zsh/plugins/vagrant/_vagrant
  70. +14 −6 home/.oh-my-zsh/plugins/vi-mode/vi-mode.plugin.zsh
  71. +54 −41 home/.oh-my-zsh/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
  72. +5 −1 home/.oh-my-zsh/plugins/vundle/vundle.plugin.zsh
  73. +12 −0 home/.oh-my-zsh/plugins/zeus/README.md
  74. +17 −6 home/.oh-my-zsh/plugins/zeus/zeus.plugin.zsh
  75. +35 −2 home/.oh-my-zsh/templates/zshrc.zsh-template
  76. +1 −1  home/.oh-my-zsh/themes/af-magic.zsh-theme
  77. +59 −3 home/.oh-my-zsh/themes/agnoster.zsh-theme
  78. +13 −3 home/.oh-my-zsh/themes/blinks.zsh-theme
  79. +5 −1 home/.oh-my-zsh/themes/cloud.zsh-theme
  80. +1 −1  home/.oh-my-zsh/themes/crunch.zsh-theme
  81. +2 −2 home/.oh-my-zsh/themes/dallas.zsh-theme
  82. +1 −1  home/.oh-my-zsh/themes/fino-time.zsh-theme
  83. +10 −12 home/.oh-my-zsh/themes/fino.zsh-theme
  84. +10 −1 home/.oh-my-zsh/themes/fishy.zsh-theme
  85. +4 −2 home/.oh-my-zsh/themes/frisk.zsh-theme
  86. +2 −2 home/.oh-my-zsh/themes/gallois.zsh-theme
  87. +5 −1 home/.oh-my-zsh/themes/gentoo.zsh-theme
  88. +39 −24 home/.oh-my-zsh/themes/jonathan.zsh-theme
  89. +1 −1  home/.oh-my-zsh/themes/josh.zsh-theme
  90. +0 −80 home/.oh-my-zsh/themes/linuxonly
  91. +1 −1  home/.oh-my-zsh/themes/macovsky-ruby.zsh-theme
  92. +1 −1  home/.oh-my-zsh/themes/macovsky.zsh-theme
  93. +14 −11 home/.oh-my-zsh/themes/minimal.zsh-theme
  94. +2 −1  home/.oh-my-zsh/themes/mortalscumbag.zsh-theme
  95. +1 −1  home/.oh-my-zsh/themes/norm.zsh-theme
  96. +30 −5 home/.oh-my-zsh/themes/pygmalion.zsh-theme
  97. +3 −1 home/.oh-my-zsh/themes/rkj-repos.zsh-theme
  98. +3 −2 home/.oh-my-zsh/themes/rkj.zsh-theme
  99. +2 −1  home/.oh-my-zsh/themes/robbyrussell.zsh-theme
  100. +1 −0  home/.oh-my-zsh/themes/smt.zsh-theme
  101. +11 −11 home/.oh-my-zsh/themes/sunrise.zsh-theme
  102. +4 −4 home/.oh-my-zsh/themes/superjarin.zsh-theme
  103. +3 −2 home/.oh-my-zsh/themes/wedisagree.zsh-theme
  104. +22 −12 home/.oh-my-zsh/themes/zhann.zsh-theme
  105. +9 −1 home/.oh-my-zsh/tools/check_for_upgrade.sh
  106. +13 −6 home/.oh-my-zsh/tools/install.sh
  107. +2 −1  home/.oh-my-zsh/tools/theme_chooser.sh
  108. +13 −5 home/.oh-my-zsh/tools/uninstall.sh
  109. +2 −5 home/.oh-my-zsh/tools/upgrade.sh
View
6 home/.oh-my-zsh/.gitignore
@@ -1,9 +1,9 @@
locals.zsh
log/.zsh_history
projects.zsh
-!custom/*
-custom/example
-custom/example.zsh
+custom/*
+!custom/example
+!custom/example.zsh
*.swp
!custom/example.zshcache
cache/
View
33 home/.oh-my-zsh/README.textile
@@ -1,5 +1,6 @@
-A handful of functions, auto-complete helpers, and stuff that makes you shout...
+!https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png!
+oh-my-zsh is an open source, community-driven framework for managing your ZSH configuration. It comes bundled with a ton of helpful functions, helpers, plugins, themes, and few things that make you shout...
bq. "OH MY ZSHELL!"
@@ -13,11 +14,11 @@ You can install this via the command line with either `curl` or `wget`.
h4. via `curl`
-@curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh@
+@curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh@
h4. via `wget`
-@wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@
+@wget --no-check-certificate https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh@
h3. The manual way
@@ -26,17 +27,20 @@ h3. The manual way
@git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@
-2. Create a new zsh config by copying the zsh template we've provided.
+2. *OPTIONAL* Backup your existing ~/.zshrc file
- *NOTE*: If you already have a ~/.zshrc file, you should back it up. @cp ~/.zshrc ~/.zshrc.orig@ in case you want to go back to your original settings.
+ @cp ~/.zshrc ~/.zshrc.orig@
+
+3. Create a new zsh config by copying the zsh template we've provided.
@cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@
-3. Set zsh as your default shell:
+
+4. Set zsh as your default shell:
@chsh -s /bin/zsh@
-4. Start / restart zsh (open a new terminal is easy enough...)
+5. Start / restart zsh (open a new terminal is easy enough...)
h3. Problems?
@@ -60,6 +64,17 @@ If you want to override any of the default behavior, just add a new file (ending
If you have many functions which go well together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin.
If you would like to override the functionality of a plugin distributed with oh-my-zsh, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@.
+h3. Updates
+
+By default you will be prompted to check for updates. If you would like oh-my-zsh to automatically update itself without prompting you, set the following in your ~/.zshrc
+
+@DISABLE_UPDATE_PROMPT=true@
+
+To disable updates entirely, put this in your ~/.zshrc
+
+@DISABLE_AUTO_UPDATE=true@
+
+To upgrade directly from the command line, just run @upgrade_oh_my_zsh@
h3. Uninstalling
@@ -73,9 +88,7 @@ h3. (Don't) Send us your theme! (for now)
-I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory.-
-We have enough themes for the time being. Please fork the project and add on in there, you can let people know how to grab it from there.
-
-
+We have enough themes for the time being. Please fork the project and add on in there, you can let people know how to grab it from there.
h2. Contributors
View
1  home/.oh-my-zsh/custom/aliases.zsh
@@ -33,7 +33,6 @@ alias ls='ls -G '
alias offlineimap-tty='offlineimap -u TTY.TTYUI'
alias hnb-partecs='hnb $HOME/partecs/partecs-hnb.xml'
alias rest2html-css='rst2html --embed-stylesheet --stylesheet-path=/usr/share/python-docutils/s5_html/themes/default/print.css'
-alias vim='/Applications/MacVim.app/Contents/MacOS/Vim'
autoload -U edit-command-line
zle -N edit-command-line
View
16 home/.oh-my-zsh/lib/aliases.zsh
@@ -8,16 +8,28 @@ alias -- -='cd -'
# Super user
alias _='sudo'
+alias please='sudo'
#alias g='grep -in'
# Show history
-alias history='fc -l 1'
-
+if [ "$HIST_STAMPS" = "mm/dd/yyyy" ]
+then
+ alias history='fc -fl 1'
+elif [ "$HIST_STAMPS" = "dd.mm.yyyy" ]
+then
+ alias history='fc -El 1'
+elif [ "$HIST_STAMPS" = "yyyy-mm-dd" ]
+then
+ alias history='fc -il 1'
+else
+ alias history='fc -l 1'
+fi
# List direcory contents
alias lsa='ls -lah'
alias l='ls -la'
alias ll='ls -l'
+alias la='ls -lA'
alias sl=ls # often screw this up
alias afind='ack-grep -il'
View
5 home/.oh-my-zsh/lib/completion.zsh
@@ -32,10 +32,12 @@ zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-dir
cdpath=(.)
# use /etc/hosts and known_hosts for hostname completion
-[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
+[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _global_ssh_hosts=()
[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
+[ -r ~/.ssh/config ] && _ssh_config=($(cat ~/.ssh/config | sed -ne 's/Host[=\t ]//p')) || _ssh_config=()
[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
hosts=(
+ "$_ssh_config[@]"
"$_global_ssh_hosts[@]"
"$_ssh_hosts[@]"
"$_etc_hosts[@]"
@@ -43,6 +45,7 @@ hosts=(
localhost
)
zstyle ':completion:*:hosts' hosts $hosts
+zstyle ':completion:*' users off
# Use caching so that commands like apt and dpkg complete are useable
zstyle ':completion::complete:*' use-cache 1
View
7 home/.oh-my-zsh/lib/correction.zsh
@@ -1,5 +1,3 @@
-setopt correct_all
-
alias man='nocorrect man'
alias mv='nocorrect mv'
alias mysql='nocorrect mysql'
@@ -8,3 +6,8 @@ alias gist='nocorrect gist'
alias heroku='nocorrect heroku'
alias ebuild='nocorrect ebuild'
alias hpodder='nocorrect hpodder'
+alias sudo='nocorrect sudo'
+
+if [[ "$ENABLE_CORRECTION" == "true" ]]; then
+ setopt correct_all
+fi
View
29 home/.oh-my-zsh/lib/directories.zsh
@@ -2,6 +2,7 @@
setopt auto_name_dirs
setopt auto_pushd
setopt pushd_ignore_dups
+setopt pushdminus
alias ..='cd ..'
alias cd..='cd ..'
@@ -11,14 +12,14 @@ alias cd.....='cd ../../../..'
alias cd/='cd /'
alias 1='cd -'
-alias 2='cd +2'
-alias 3='cd +3'
-alias 4='cd +4'
-alias 5='cd +5'
-alias 6='cd +6'
-alias 7='cd +7'
-alias 8='cd +8'
-alias 9='cd +9'
+alias 2='cd -2'
+alias 3='cd -3'
+alias 4='cd -4'
+alias 5='cd -5'
+alias 6='cd -6'
+alias 7='cd -7'
+alias 8='cd -8'
+alias 9='cd -9'
cd () {
if [[ "x$*" == "x..." ]]; then
@@ -26,9 +27,12 @@ cd () {
elif [[ "x$*" == "x...." ]]; then
cd ../../..
elif [[ "x$*" == "x....." ]]; then
- cd ../../..
- elif [[ "x$*" == "x......" ]]; then
cd ../../../..
+ elif [[ "x$*" == "x......" ]]; then
+ cd ../../../../..
+ elif [ -d ~/.autoenv ]; then
+ source ~/.autoenv/activate.sh
+ autoenv_cd "$@"
else
builtin cd "$@"
fi
@@ -37,8 +41,3 @@ cd () {
alias md='mkdir -p'
alias rd=rmdir
alias d='dirs -v | head -10'
-
-# mkdir & cd to it
-function mcd() {
- mkdir -p "$1" && cd "$1";
-}
View
3  home/.oh-my-zsh/lib/edit-command-line.zsh
@@ -1,3 +0,0 @@
-autoload -U edit-command-line
-zle -N edit-command-line
-bindkey '\C-x\C-e' edit-command-line
View
60 home/.oh-my-zsh/lib/functions.zsh
@@ -1,5 +1,5 @@
function zsh_stats() {
- history | awk '{print $2}' | sort | uniq -c | sort -rn | head
+ history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
}
function uninstall_oh_my_zsh() {
@@ -15,3 +15,61 @@ function take() {
cd $1
}
+#
+# Get the value of an alias.
+#
+# Arguments:
+# 1. alias - The alias to get its value from
+# STDOUT:
+# The value of alias $1 (if it has one).
+# Return value:
+# 0 if the alias was found,
+# 1 if it does not exist
+#
+function alias_value() {
+ alias "$1" | sed "s/^$1='\(.*\)'$/\1/"
+ test $(alias "$1")
+}
+
+#
+# Try to get the value of an alias,
+# otherwise return the input.
+#
+# Arguments:
+# 1. alias - The alias to get its value from
+# STDOUT:
+# The value of alias $1, or $1 if there is no alias $1.
+# Return value:
+# Always 0
+#
+function try_alias_value() {
+ alias_value "$1" || echo "$1"
+}
+
+#
+# Set variable "$1" to default value "$2" if "$1" is not yet defined.
+#
+# Arguments:
+# 1. name - The variable to set
+# 2. val - The default value
+# Return value:
+# 0 if the variable exists, 3 if it was set
+#
+function default() {
+ test `typeset +m "$1"` && return 0
+ typeset -g "$1"="$2" && return 3
+}
+
+#
+# Set enviroment variable "$1" to default value "$2" if "$1" is not yet defined.
+#
+# Arguments:
+# 1. name - The env variable to set
+# 2. val - The default value
+# Return value:
+# 0 if the env variable exists, 3 if it was set
+#
+function env_default() {
+ env | grep -q "^$1=" && return 0
+ export "$1=$2" && return 3
+}
View
75 home/.oh-my-zsh/lib/git.zsh
@@ -1,46 +1,79 @@
# get the name of the branch we are on
function git_prompt_info() {
- ref=$(git symbolic-ref HEAD 2> /dev/null) || return
- echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
+ if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
+ ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
+ ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
+ echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
+ fi
}
# Checks if working tree is dirty
parse_git_dirty() {
local SUBMODULE_SYNTAX=''
- if [[ $POST_1_7_2_GIT -gt 0 ]]; then
- SUBMODULE_SYNTAX="--ignore-submodules=dirty"
- fi
- if [[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]]; then
- echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
+ local GIT_STATUS=''
+ local CLEAN_MESSAGE='nothing to commit (working directory clean)'
+ if [[ "$(command git config --get oh-my-zsh.hide-status)" != "1" ]]; then
+ if [[ $POST_1_7_2_GIT -gt 0 ]]; then
+ SUBMODULE_SYNTAX="--ignore-submodules=dirty"
+ fi
+ if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then
+ GIT_STATUS=$(command git status -s ${SUBMODULE_SYNTAX} -uno 2> /dev/null | tail -n1)
+ else
+ GIT_STATUS=$(command git status -s ${SUBMODULE_SYNTAX} 2> /dev/null | tail -n1)
+ fi
+ if [[ -n $GIT_STATUS ]]; then
+ echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
+ else
+ echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
+ fi
else
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
fi
}
+# get the difference between the local and remote branches
+git_remote_status() {
+ remote=${$(command git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/}
+ if [[ -n ${remote} ]] ; then
+ ahead=$(command git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
+ behind=$(command git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
+
+ if [ $ahead -eq 0 ] && [ $behind -gt 0 ]
+ then
+ echo "$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE"
+ elif [ $ahead -gt 0 ] && [ $behind -eq 0 ]
+ then
+ echo "$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE"
+ elif [ $ahead -gt 0 ] && [ $behind -gt 0 ]
+ then
+ echo "$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE"
+ fi
+ fi
+}
# Checks if there are commits ahead from remote
function git_prompt_ahead() {
- if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
+ if $(echo "$(command git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
fi
}
# Formats prompt string for current git commit short SHA
function git_prompt_short_sha() {
- SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
+ SHA=$(command git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
}
# Formats prompt string for current git commit long SHA
function git_prompt_long_sha() {
- SHA=$(git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
+ SHA=$(command git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
}
# Get the status of the working tree
git_prompt_status() {
- INDEX=$(git status --porcelain 2> /dev/null)
+ INDEX=$(command git status --porcelain -b 2> /dev/null)
STATUS=""
- if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
+ if $(echo "$INDEX" | grep -E '^\?\? ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
fi
if $(echo "$INDEX" | grep '^A ' &> /dev/null); then
@@ -60,23 +93,37 @@ git_prompt_status() {
fi
if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
+ elif $(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 $(command git rev-parse --verify refs/stash >/dev/null 2>&1); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_STASHED$STATUS"
+ fi
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
fi
+ if $(echo "$INDEX" | grep '^## .*ahead' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS"
+ fi
+ if $(echo "$INDEX" | grep '^## .*behind' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS"
+ fi
+ if $(echo "$INDEX" | grep '^## .*diverged' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS"
+ fi
echo $STATUS
}
#compare the provided version of git to the version installed and on path
#prints 1 if input version <= installed version
-#prints -1 otherwise
+#prints -1 otherwise
function git_compare_version() {
local INPUT_GIT_VERSION=$1;
local INSTALLED_GIT_VERSION
INPUT_GIT_VERSION=(${(s/./)INPUT_GIT_VERSION});
- INSTALLED_GIT_VERSION=($(git --version));
+ INSTALLED_GIT_VERSION=($(command git --version 2>/dev/null));
INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]});
for i in {1..3}; do
View
4 home/.oh-my-zsh/lib/history.zsh
@@ -1,5 +1,7 @@
## Command history configuration
-HISTFILE=$HOME/.zsh_history
+if [ -z $HISTFILE ]; then
+ HISTFILE=$HOME/.zsh_history
+fi
HISTSIZE=10000
SAVEHIST=10000
View
5 home/.oh-my-zsh/lib/key-bindings.zsh
@@ -30,6 +30,11 @@ bindkey "^[[3~" delete-char
bindkey "^[3;5~" delete-char
bindkey "\e[3~" delete-char
+# Edit the current command line in $EDITOR
+autoload -U edit-command-line
+zle -N edit-command-line
+bindkey '\C-x\C-e' edit-command-line
+
# consider emacs keybindings:
#bindkey -e ## emacs key bindings
View
4 home/.oh-my-zsh/lib/misc.zsh
@@ -9,5 +9,7 @@ bindkey "^[m" copy-prev-shell-word
setopt long_list_jobs
## pager
-export PAGER="less -R"
+export PAGER="less"
+export LESS="-R"
+
export LC_CTYPE=$LANG
View
9 home/.oh-my-zsh/lib/rvm.zsh
@@ -1,5 +1,8 @@
-# get the name of the branch we are on
+# get the name of the ruby version
function rvm_prompt_info() {
- ruby_version=$(~/.rvm/bin/rvm-prompt 2> /dev/null) || return
- [[ ! -z $ruby_version ]] && echo "($ruby_version)"
+ [ -f $HOME/.rvm/bin/rvm-prompt ] || return
+ local rvm_prompt
+ rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
+ [[ "${rvm_prompt}x" == "x" ]] && return
+ echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
}
View
7 home/.oh-my-zsh/lib/spectrum.zsh
@@ -26,3 +26,10 @@ function spectrum_ls() {
done
}
+# Show all 256 colors where the background is set to specific color
+function spectrum_bls() {
+ for code in {000..255}; do
+ ((cc = code + 1))
+ print -P -- "$BG[$code]$code: Test %{$reset_color%}"
+ done
+}
View
8 home/.oh-my-zsh/lib/termsupport.zsh
@@ -8,7 +8,7 @@ function title {
fi
if [[ "$TERM" == screen* ]]; then
print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
- elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
+ elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ $TERM == ansi ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
print -Pn "\e]2;$2:q\a" #set window name
print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
fi
@@ -26,8 +26,10 @@ function omz_termsupport_precmd {
function omz_termsupport_preexec {
emulate -L zsh
setopt extended_glob
- local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
- title "$CMD" "%100>...>$2%<<"
+ local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
+ local LINE="${2:gs/$/\\$}"
+ LINE="${LINE:gs/%/%%}"
+ title "$CMD" "%100>...>$LINE%<<"
}
autoload -U add-zsh-hook
View
12 home/.oh-my-zsh/lib/theme-and-appearance.zsh
@@ -7,7 +7,17 @@ export LSCOLORS="Gxfxcxdxbxegedabagacad"
if [ "$DISABLE_LS_COLORS" != "true" ]
then
# Find the option for using colors in ls, depending on the version: Linux or BSD
- ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
+ if [[ "$(uname -s)" == "NetBSD" ]]; then
+ # On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
+ # otherwise, leave ls as is, because NetBSD's ls doesn't support -G
+ gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
+ elif [[ "$(uname -s)" == "OpenBSD" ]]; then
+ # On OpenBSD, test if "colorls" is installed (this one supports colors);
+ # otherwise, leave ls as is, because OpenBSD's ls doesn't support -G
+ colorls -G -d . &>/dev/null 2>&1 && alias ls='colorls -G'
+ else
+ ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
+ fi
fi
#setopt no_beep
View
39 home/.oh-my-zsh/oh-my-zsh.sh
@@ -1,7 +1,6 @@
# Check for updates on initial load...
-if [ "$DISABLE_AUTO_UPDATE" != "true" ]
-then
- /usr/bin/env ZSH=$ZSH zsh $ZSH/tools/check_for_upgrade.sh
+if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then
+ /usr/bin/env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh $ZSH/tools/check_for_upgrade.sh
fi
# Initializes Oh My Zsh
@@ -11,7 +10,9 @@ fpath=($ZSH/functions $ZSH/completions $fpath)
# Load all of the config files in ~/oh-my-zsh that end in .zsh
# TIP: Add files you don't want in git to .gitignore
-for config_file ($ZSH/lib/*.zsh) source $config_file
+for config_file ($ZSH/lib/*.zsh); do
+ source $config_file
+done
# Set ZSH_CUSTOM to the path where your custom config files
# and plugins exists, or else we will use the default custom/
@@ -36,10 +37,20 @@ for plugin ($plugins); do
fi
done
+# Figure out the SHORT hostname
+if [ -n "$commands[scutil]" ]; then
+ # OS X
+ SHORT_HOST=$(scutil --get ComputerName)
+else
+ SHORT_HOST=${HOST/.*/}
+fi
+
+# Save the location of the current completion dump file.
+ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
+
# Load and run compinit
autoload -U compinit
-compinit -i
-
+compinit -i -d "${ZSH_COMPDUMP}"
# Load all of the plugins that were defined in ~/.zshrc
for plugin ($plugins); do
@@ -51,11 +62,13 @@ for plugin ($plugins); do
done
# Load all of your custom configurations from custom/
-for config_file ($ZSH_CUSTOM/*.zsh(N)) source $config_file
+for config_file ($ZSH_CUSTOM/*.zsh(N)); do
+ source $config_file
+done
+unset config_file
# Load the theme
-if [ "$ZSH_THEME" = "random" ]
-then
+if [ "$ZSH_THEME" = "random" ]; then
themes=($ZSH/themes/*zsh-theme)
N=${#themes[@]}
((N=(RANDOM%N)+1))
@@ -63,11 +76,11 @@ then
source "$RANDOM_THEME"
echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
else
- if [ ! "$ZSH_THEME" = "" ]
- then
- if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]
- then
+ if [ ! "$ZSH_THEME" = "" ]; then
+ if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]; then
source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme"
+ elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]; then
+ source "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme"
else
source "$ZSH/themes/$ZSH_THEME.zsh-theme"
fi
View
16 home/.oh-my-zsh/plugins/ant/ant.plugin.zsh
@@ -1,17 +1,7 @@
-stat -f%m . > /dev/null 2>&1
-if [ "$?" = 0 ]; then
- stat_cmd=(stat -f%m)
-else
- stat_cmd=(stat -L --format=%Y)
-fi
-
_ant_does_target_list_need_generating () {
- if [ ! -f .ant_targets ]; then return 0;
- else
- accurate=$($stat_cmd .ant_targets)
- changed=$($stat_cmd build.xml)
- return $(expr $accurate '>=' $changed)
- fi
+ [ ! -f .ant_targets ] && return 0;
+ [ .ant_targets -nt build.xml ] && return 0;
+ return 1;
}
_ant () {
View
24 home/.oh-my-zsh/plugins/archlinux/archlinux.plugin.zsh
@@ -8,16 +8,18 @@ if [[ -x `which yaourt` ]]; then
}
alias yaconf='yaourt -C' # Fix all configuration files with vimdiff
# Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
- alias yaupg='yaourt -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system.
+ alias yaupg='yaourt -Syua' # Synchronize with repositories before upgrading packages (AUR packages too) that are out of date on the local system.
alias yasu='yaourt --sucre' # Same as yaupg, but without confirmation
alias yain='yaourt -S' # Install specific package(s) from the repositories
- alias yains='yaourt -U' # Install specific package not from the repositories but from a file
+ alias yains='yaourt -U' # Install specific package not from the repositories but from a file
alias yare='yaourt -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies
alias yarem='yaourt -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies
alias yarep='yaourt -Si' # Display information about a given package in the repositories
alias yareps='yaourt -Ss' # Search for package(s) in the repositories
alias yaloc='yaourt -Qi' # Display information about a given package in the local database
alias yalocs='yaourt -Qs' # Search for package(s) in the local database
+ alias yalst='yaourt -Qe' # List installed packages, even those installed from AUR (they're tagged as "local")
+ alias yaorph='yaourt -Qtd' # Remove orphans using yaourt
# Additional yaourt alias examples
if [[ -x `which abs` ]]; then
alias yaupd='yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
@@ -35,7 +37,7 @@ fi
# Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
alias pacupg='sudo pacman -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system.
alias pacin='sudo pacman -S' # Install specific package(s) from the repositories
-alias pacins='sudo pacman -U' # Install specific package not from the repositories but from a file
+alias pacins='sudo pacman -U' # Install specific package not from the repositories but from a file
alias pacre='sudo pacman -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies
alias pacrem='sudo pacman -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies
alias pacrep='pacman -Si' # Display information about a given package in the repositories
@@ -75,3 +77,19 @@ pacdisowned() {
comm -23 "$fs" "$db"
}
+
+pacmanallkeys() {
+ # Get all keys for developers and trusted users
+ curl https://www.archlinux.org/{developers,trustedusers}/ |
+ awk -F\" '(/pgp.mit.edu/) {sub(/.*search=0x/,"");print $1}' |
+ xargs sudo pacman-key --recv-keys
+}
+
+pacmansignkeys() {
+ for key in $*; do
+ sudo pacman-key --recv-keys $key
+ sudo pacman-key --lsign-key $key
+ printf 'trust\n3\n' | sudo gpg --homedir /etc/pacman.d/gnupg \
+ --no-permission-warning --command-fd 0 --edit-key $key
+ done
+}
View
10 home/.oh-my-zsh/plugins/autojump/autojump.plugin.zsh
@@ -3,9 +3,15 @@ if [ $commands[autojump] ]; then # check if autojump is installed
. /usr/share/autojump/autojump.zsh
elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
. /etc/profile.d/autojump.zsh
+ elif [ -f /etc/profile.d/autojump.sh ]; then # gentoo installation
+ . /etc/profile.d/autojump.sh
+ elif [ -f /usr/local/share/autojump/autojump.zsh ]; then # freebsd installation
+ . /usr/local/share/autojump/autojump.zsh
+ elif [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation
+ . $HOME/.autojump/etc/profile.d/autojump.zsh
elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports
. /opt/local/etc/profile.d/autojump.zsh
- elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump ]; then # mac os x with brew
- . `brew --prefix`/etc/autojump
+ elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.zsh ]; then # mac os x with brew
+ . `brew --prefix`/etc/autojump.zsh
fi
fi
View
100 home/.oh-my-zsh/plugins/battery/battery.plugin.zsh
@@ -1,20 +1,92 @@
-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 ',') }
+###########################################
+# Battery plugin for oh-my-zsh #
+# Original Author: Peter hoeg (peterhoeg) #
+# Email: peter@speartail.com #
+###########################################
+# Author: Sean Jones (neuralsandwich) #
+# Email: neuralsandwich@gmail.com #
+# Modified to add support for Apple Mac #
+###########################################
+
+if [[ $(uname) == "Darwin" ]] ; then
+
+ function battery_pct() {
+ typeset -F maxcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"MaxCapacity"\ =\ ' | sed -e 's/^.*"MaxCapacity"\ =\ //')
+ typeset -F currentcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"CurrentCapacity"\ =\ ' | sed -e 's/^.*CurrentCapacity"\ =\ //')
+ integer i=$(((currentcapacity/maxcapacity) * 100))
+ echo $i
+ }
+
+ function battery_pct_remaining() {
+ if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
+ battery_pct
+ else
+ echo "External Power"
+ fi
+ }
+
+ function battery_time_remaining() {
+ if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
+ timeremaining=$(ioreg -rc "AppleSmartBattery"| grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //')
+ echo "~$((timeremaining / 60)):$((timeremaining % 60))"
+ else
+ echo ""
+ fi
+ }
+
+ function battery_pct_prompt () {
+ if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
+ 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
+ echo ""
+ fi
+ }
+
+elif [[ $(uname) == "Linux" ]] ; then
+
+ function battery_pct_remaining() {
+ if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
+ echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')"
+ fi
+ }
+
+ function battery_time_remaining() {
+ if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
+ echo $(acpi | cut -f3 -d ',')
+ fi
+ }
+
function battery_pct_prompt() {
- b=$(battery_pct_remaining)
- if [ $b -gt 50 ] ; then
- color='green'
- elif [ $b -gt 20 ] ; then
- color='yellow'
+ b=$(battery_pct_remaining)
+ if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
+ 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
- color='red'
+ echo ""
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 '' }
+ # Empty functions so we don't cause errors in prompts
+ function battery_pct_remaining() {
+ }
+
+ function battery_time_remaining() {
+ }
+
+ function battery_pct_prompt() {
+ }
fi
View
7 home/.oh-my-zsh/plugins/brew/_brew
@@ -26,8 +26,10 @@ _1st_arguments=(
'list:list files in a formula or not-installed formulae'
'log:git commit log for a formula'
'missing:check all installed formuale for missing dependencies.'
+ 'options:display install options specific to formula.'
'outdated:list formulas for which a newer version is available'
'prune:remove dead links'
+ 'reinstall:reinstall a formula'
'remove:remove a formula'
'search:search for a formula (/regex/ or string)'
'server:start a local web app that lets you browse formulae (requires Sinatra)'
@@ -35,6 +37,7 @@ _1st_arguments=(
'update:freshen up links'
'upgrade:upgrade outdated formulae'
'uses:show formulas which depend on a formula'
+ 'versions:show all available formula versions'
)
local expl
@@ -71,10 +74,10 @@ case "$words[1]" in
_brew_installed_formulae
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
fi ;;
- install|home|homepage|log|info|abv|uses|cat|deps|edit|options)
+ install|home|homepage|log|info|abv|uses|cat|deps|edit|options|versions)
_brew_all_formulae
_wanted formulae expl 'all formulae' compadd -a formulae ;;
- remove|rm|uninstall|unlink|cleanup|link|ln)
+ reinstall|remove|rm|uninstall|unlink|cleanup|link|ln)
_brew_installed_formulae
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
esac
View
9 home/.oh-my-zsh/plugins/bundler/_bundler
@@ -23,6 +23,7 @@ case $state in
"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]" \
+ "clean[Cleans up unused gems in your bundler directory]" \
"help[Describe available tasks or one specific task]"
ret=0
;;
@@ -62,6 +63,14 @@ case $state in
exec)
_normal && ret=0
;;
+ clean)
+ _arguments \
+ '(--force)--force[forces clean even if --path is not set]' \
+ '(--dry-run)--dry-run[only print out changes, do not actually clean gems]' \
+ '(--no-color)--no-color[Disable colorization in output]' \
+ '(--verbose)--verbose[Enable verbose output mode]'
+ ret=0
+ ;;
(open|show)
_gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') )
if [[ $_gems != "" ]]; then
View
30 home/.oh-my-zsh/plugins/bundler/bundler.plugin.zsh
@@ -1,15 +1,39 @@
alias be="bundle exec"
-alias bi="bundle install"
alias bl="bundle list"
alias bp="bundle package"
+alias bo="bundle open"
alias bu="bundle update"
# The following is based on https://github.com/gma/bundler-exec
-bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails puma)
+bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard jekyll kitchen knife middleman nanoc rackup rainbows rake rspec ruby shotgun spec spin spork strainer tailor taps thin thor unicorn unicorn_rails puma)
+
+# Remove $UNBUNDLED_COMMANDS from the bundled_commands list
+for cmd in $UNBUNDLED_COMMANDS; do
+ bundled_commands=(${bundled_commands#$cmd});
+done
## Functions
+bi() {
+ if _bundler-installed && _within-bundled-project; then
+ local bundler_version=`bundle version | cut -d' ' -f3`
+ if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then
+ if [[ "$(uname)" == 'Darwin' ]]
+ then
+ local cores_num="$(sysctl hw.ncpu | awk '{print $2}')"
+ else
+ local cores_num="$(nproc)"
+ fi
+ bundle install --jobs=$cores_num $@
+ else
+ bundle install $@
+ fi
+ else
+ echo "Can't 'bundle install' outside a bundled project"
+ fi
+}
+
_bundler-installed() {
which bundle > /dev/null 2>&1
}
@@ -33,6 +57,7 @@ _run-with-bundler() {
## Main program
for cmd in $bundled_commands; do
+ eval "function unbundled_$cmd () { $cmd \$@ }"
eval "function bundled_$cmd () { _run-with-bundler $cmd \$@}"
alias $cmd=bundled_$cmd
@@ -40,3 +65,4 @@ for cmd in $bundled_commands; do
compdef _$cmd bundled_$cmd=$cmd
fi
done
+
View
11 home/.oh-my-zsh/plugins/cake/cake.plugin.zsh
@@ -14,12 +14,9 @@ _cake_does_target_list_need_generating () {
return 1;
fi
- if [ ! -f ${_cake_task_cache_file} ]; then return 0;
- else
- accurate=$(stat -f%m $_cake_task_cache_file)
- changed=$(stat -f%m Cakefile)
- return $(expr $accurate '>=' $changed)
- fi
+ [ ! -f ${_cake_task_cache_file} ] && return 0;
+ [ ${_cake_task_cache_file} -nt Cakefile ] && return 0;
+ return 1;
}
_cake () {
@@ -33,4 +30,4 @@ _cake () {
fi
}
-compdef _cake cake
+compdef _cake cake
View
6 home/.oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh
@@ -2,4 +2,8 @@
# as seen in http://www.porcheron.info/command-not-found-for-zsh/
# this is installed in Ubuntu
-source /etc/zsh_command_not_found
+[[ -e /etc/zsh_command_not_found ]] && source /etc/zsh_command_not_found
+
+# Arch Linux command-not-found support, you must have package pkgfile installed
+# https://wiki.archlinux.org/index.php/Pkgfile#.22Command_not_found.22_hook
+[[ -e /usr/share/doc/pkgfile/command-not-found.zsh ]] && source /usr/share/doc/pkgfile/command-not-found.zsh
View
23 home/.oh-my-zsh/plugins/composer/composer.plugin.zsh
@@ -10,9 +10,27 @@ _composer_get_command_list () {
composer --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }'
}
+_composer_get_required_list () {
+ composer show -s --no-ansi | sed '1,/requires/d' | awk 'NF > 0 && !/^requires \(dev\)/{ print $1 }'
+}
+
_composer () {
+ local curcontext="$curcontext" state line
+ typeset -A opt_args
+ _arguments \
+ '1: :->command'\
+ '*: :->args'
if [ -f composer.json ]; then
- compadd `_composer_get_command_list`
+ case $state in
+ command)
+ compadd `_composer_get_command_list`
+ ;;
+ *)
+ compadd `_composer_get_required_list`
+ ;;
+ esac
+ else
+ compadd create-project init search selfupdate show
fi
}
@@ -24,6 +42,7 @@ alias csu='composer self-update'
alias cu='composer update'
alias ci='composer install'
alias ccp='composer create-project'
+alias cdu='composer dump-autoload'
# install composer in the current directory
-alias cget='curl -s https://getcomposer.org/installer | php'
+alias cget='curl -s https://getcomposer.org/installer | php'
View
49 home/.oh-my-zsh/plugins/debian/debian.plugin.zsh
@@ -1,19 +1,20 @@
# Authors:
# https://github.com/AlexBio
# https://github.com/dbb
+# https://github.com/Mappleconfusers
#
# Debian-related zsh aliases and functions for zsh
# Use aptitude if installed, or apt-get if not.
# You can just set apt_pref='apt-get' to override it.
-if [[ -e $( which aptitude ) ]]; then
+if [[ -e $( which -p aptitude 2>&1 ) ]]; then
apt_pref='aptitude'
else
apt_pref='apt-get'
fi
# Use sudo by default if it's installed
-if [[ -e $( which sudo ) ]]; then
+if [[ -e $( which -p sudo 2>&1 ) ]]; then
use_sudo=1
fi
@@ -21,7 +22,7 @@ fi
# These are for more obscure uses of apt-get and aptitude that aren't covered
# below.
alias ag='apt-get'
-alias at='aptitude'
+alias ap='aptitude'
# Some self-explanatory aliases
alias acs="apt-cache search"
@@ -35,7 +36,7 @@ alias afs='apt-file search --regexp'
# These are apt-get only
alias asrc='apt-get source'
-alias ap='apt-cache policy'
+alias app='apt-cache policy'
# superuser operations ######################################################
if [[ $use_sudo -eq 1 ]]; then
@@ -56,12 +57,13 @@ if [[ $use_sudo -eq 1 ]]; then
alias ar='sudo $apt_pref remove'
# apt-get only
- alias ads='sudo $apt_pref dselect-upgrade'
+ alias ads='sudo apt-get dselect-upgrade'
# Install all .deb files in the current directory.
# Warning: you will need to put the glob in single quotes if you use:
# glob_subst
- alias di='sudo dpkg -i ./*.deb'
+ alias dia='sudo dpkg -i ./*.deb'
+ alias di='sudo dpkg -i'
# Remove ALL kernel images and headers EXCEPT the one in use
alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \
@@ -100,13 +102,46 @@ else
# Install all .deb files in the current directory
# Assumes glob_subst is off
- alias di='su -lc "dpkg -i ./*.deb" root'
+ alias dia='su -lc "dpkg -i ./*.deb" root'
+ alias di='su -lc "dpkg -i" root'
# Remove ALL kernel images and headers EXCEPT the one in use
alias kclean='su -lc '\''aptitude remove -P ?and(~i~nlinux-(ima|hea) \
?not(~n`uname -r`))'\'' root'
fi
+# Completion ################################################################
+
+#
+# Registers a compdef for $1 that calls $apt_pref with the commands $2
+# To do that it creates a new completion function called _apt_pref_$2
+#
+apt_pref_compdef() {
+ local f fb
+ f="_apt_pref_${2}"
+
+ eval "function ${f}() {
+ shift words;
+ service=\"\$apt_pref\";
+ words=(\"\$apt_pref\" '$2' \$words);
+ ((CURRENT++))
+ test \"\${apt_pref}\" = 'aptitude' && _aptitude || _apt
+ }"
+
+ compdef "$f" "$1"
+}
+
+apt_pref_compdef aac "autoclean"
+apt_pref_compdef abd "build-dep"
+apt_pref_compdef ac "clean"
+apt_pref_compdef ad "update"
+apt_pref_compdef afu "update"
+apt_pref_compdef ag "upgrade"
+apt_pref_compdef ai "install"
+apt_pref_compdef ail "install"
+apt_pref_compdef ap "purge"
+apt_pref_compdef ar "remove"
+apt_pref_compdef ads "dselect-upgrade"
# Misc. #####################################################################
# print all installed packages
View
15 home/.oh-my-zsh/plugins/django/django.plugin.zsh
@@ -20,6 +20,19 @@ _managepy-createcachetable(){
$nul_args && ret=0
}
+_managepy-collectstatic(){
+ _arguments -s : \
+ '--link=-[Create a symbolic link to each file instead of copying.]:' \
+ '--noinput=-[Do NOT prompt the user for input of any kind.]:' \
+ '--no-post-process=-[Do NOT post process collected files.]:' \
+ '--ignore=-[Ignore files or directories matching this glob-style pattern. Use multiple times to ignore more.]:' \
+ '--dry-run=-[Do everything except modify the filesystem.]:' \
+ '--clear=-[Clear the existing files using the storage before trying to copy or link the original file.]:' \
+ '--link=-[Create a symbolic link to each file instead of copying.]:' \
+ '--no-default-ignore=-[Do not ignore the common private glob-style patterns "CVS", ".*" and "*~".]:' \
+ $nul_args && ret=0
+}
+
_managepy-dbshell(){
_arguments -s : \
$nul_args && ret=0
@@ -163,6 +176,7 @@ _managepy-commands() {
commands=(
'adminindex:prints the admin-index template snippet for the given app name(s).'
'createcachetable:creates the table needed to use the SQL cache backend.'
+ 'collectstatic:Collect static files in a single location.'
'dbshell:runs the command-line client for the current DATABASE_ENGINE.'
"diffsettings:displays differences between the current settings.py and Django's default settings."
'dumpdata:Output the contents of the database as a fixture of the given format.'
@@ -220,4 +234,5 @@ _managepy() {
compdef _managepy manage.py
compdef _managepy django
+compdef _managepy django-admin.py
compdef _managepy django-manage
View
4 home/.oh-my-zsh/plugins/encode64/encode64.plugin.zsh
@@ -1,2 +1,4 @@
encode64(){ echo -n $1 | base64 }
-decode64(){ echo -n $1 | base64 -D }
+decode64(){ echo -n $1 | base64 --decode }
+alias e64=encode64
+alias d64=decode64
View
4 home/.oh-my-zsh/plugins/extract/extract.plugin.zsh
@@ -52,8 +52,8 @@ function extract() {
(*.xz) unxz "$1" ;;
(*.lzma) unlzma "$1" ;;
(*.Z) uncompress "$1" ;;
- (*.zip) unzip "$1" -d $extract_dir ;;
- (*.rar) unrar e -ad "$1" ;;
+ (*.zip|*.war|*.jar) unzip "$1" -d $extract_dir ;;
+ (*.rar) unrar x -ad "$1" ;;
(*.7z) 7za x "$1" ;;
(*.deb)
mkdir -p "$extract_dir/control"
View
7 home/.oh-my-zsh/plugins/fasd/fasd.plugin.zsh
@@ -1,5 +1,10 @@
if [ $commands[fasd] ]; then # check if fasd is installed
- eval "$(fasd --init auto)"
+ fasd_cache="$HOME/.fasd-init-cache"
+ if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then
+ fasd --init auto >| "$fasd_cache"
+ fi
+ source "$fasd_cache"
+ unset fasd_cache
alias v='f -e vim'
alias o='a -e open'
fi
View
11 home/.oh-my-zsh/plugins/gem/_gem
@@ -4,13 +4,15 @@
# gem zsh completion, based on homebrew completion
_gem_installed() {
- installed_gems=(`gem list --local --no-versions`)
+ installed_gems=(${(f)"$(gem list --local --no-versions)"})
}
local -a _1st_arguments
+
_1st_arguments=(
+ 'build:Build a gem from a gemspec'
'cert:Manage RubyGems certificates and signing settings'
- 'check:Check installed gems'
+ 'check:Check a gem repository for added or missing files'
'cleanup:Clean up old versions of installed gems in the local repository'
'contents:Display the contents of the installed gems'
'dependency:Show the dependencies of an installed gem'
@@ -21,7 +23,7 @@ _1st_arguments=(
'install:Install a gem into the local repository'
'list:Display gems whose name starts with STRING'
'lock:Generate a lockdown list of gems'
- 'mirror:Mirror a gem repository'
+ 'mirror:Mirror all gem files (requires rubygems-mirror)'
'outdated:Display all gems that need updates'
'owner:Manage gem owners on RubyGems.org.'
'pristine:Restores installed gems to pristine condition from files located in the gem cache'
@@ -35,8 +37,9 @@ _1st_arguments=(
'stale:List gems along with access times'
'uninstall:Uninstall gems from the local repository'
'unpack:Unpack an installed gem to the current directory'
- 'update:Update the named gems (or all installed gems) in the local repository'
+ 'update:Update installed gems to the latest version'
'which:Find the location of a library file you can require'
+ 'yank:Remove a specific gem version release from RubyGems.org'
)
local expl
View
29 home/.oh-my-zsh/plugins/git-flow/git-flow.plugin.zsh
@@ -20,6 +20,12 @@
# c. Or, use this file as a oh-my-zsh plugin.
#
+#Alias
+alias gf='git flow'
+alias gcd='git checkout develop'
+alias gch='git checkout hotfix'
+alias gcr='git checkout release'
+
_git-flow ()
{
local curcontext="$curcontext" state line
@@ -88,6 +94,8 @@ __git-flow-release ()
'start:Start a new release branch.'
'finish:Finish a release branch.'
'list:List all your release branches. (Alias to `git flow release`)'
+ 'publish: public'
+ 'track: track'
)
_describe -t commands 'git flow release' subcommands
_arguments \
@@ -115,6 +123,16 @@ __git-flow-release ()
':version:__git_flow_version_list'
;;
+ (publish)
+ _arguments \
+ ':version:__git_flow_version_list'\
+ ;;
+
+ (track)
+ _arguments \
+ ':version:__git_flow_version_list'\
+ ;;
+
*)
_arguments \
-v'[Verbose (more) output]'
@@ -195,7 +213,7 @@ __git-flow-feature ()
'start:Start a new feature branch.'
'finish:Finish a feature branch.'
'list:List all your feature branches. (Alias to `git flow feature`)'
- 'publish: public'
+ 'publish: publish'
'track: track'
'diff: diff'
'rebase: rebase'
@@ -221,6 +239,7 @@ __git-flow-feature ()
_arguments \
-F'[Fetch from origin before performing finish]' \
-r'[Rebase instead of merge]'\
+ -k'[Keep branch after performing finish]'\
':feature:__git_flow_feature_list'
;;
@@ -236,13 +255,13 @@ __git-flow-feature ()
(diff)
_arguments \
- ':branch:__git_branch_names'\
+ ':branch:__git_flow_feature_list'\
;;
(rebase)
_arguments \
-i'[Do an interactive rebase]' \
- ':branch:__git_branch_names'
+ ':branch:__git_flow_feature_list'
;;
(checkout)
@@ -253,7 +272,7 @@ __git-flow-feature ()
(pull)
_arguments \
':remote:__git_remotes'\
- ':branch:__git_branch_names'
+ ':branch:__git_flow_feature_list'
;;
*)
@@ -333,4 +352,4 @@ __git_command_successful () {
return 0
}
-zstyle ':completion:*:*:git:*' user-commands flow:'description for foo'
+zstyle ':completion:*:*:git:*' user-commands flow:'description for foo'
View
105 home/.oh-my-zsh/plugins/git/git.plugin.zsh
@@ -3,33 +3,67 @@ alias g='git'
compdef g=git
alias gst='git status'
compdef _git gst=git-status
+alias gd='git diff'
+compdef _git gd=git-diff
+alias gdc='git diff --cached'
+compdef _git gdc=git-diff
alias gl='git pull'
compdef _git gl=git-pull
-alias gup='git fetch && git rebase'
+alias gup='git pull --rebase'
compdef _git gup=git-fetch
alias gp='git push'
compdef _git gp=git-push
+alias gd='git diff'
gdv() { git diff -w "$@" | view - }
compdef _git gdv=git-diff
alias gc='git commit -v'
compdef _git gc=git-commit
+alias gc!='git commit -v --amend'
+compdef _git gc!=git-commit
alias gca='git commit -v -a'
-compdef _git gca=git-commit
+compdef _git gc=git-commit
+alias gca!='git commit -v -a --amend'
+compdef _git gca!=git-commit
+alias gcmsg='git commit -m'
+compdef _git gcmsg=git-commit
alias gco='git checkout'
compdef _git gco=git-checkout
alias gcm='git checkout master'
+alias gr='git remote'
+compdef _git gr=git-remote
+alias grv='git remote -v'
+compdef _git grv=git-remote
+alias grmv='git remote rename'
+compdef _git grmv=git-remote
+alias grrm='git remote remove'
+compdef _git grrm=git-remote
+alias grset='git remote set-url'
+compdef _git grset=git-remote
+alias grup='git remote update'
+compdef _git grset=git-remote
+alias grbi='git rebase -i'
+compdef _git grbi=git-rebase
+alias grbc='git rebase --continue'
+compdef _git grbc=git-rebase
+alias grba='git rebase --abort'
+compdef _git grba=git-rebase
alias gb='git branch'
compdef _git gb=git-branch
alias gba='git branch -a'
compdef _git gba=git-branch
alias gcount='git shortlog -sn'
compdef gcount=git
+alias gcl='git config --list'
alias gcp='git cherry-pick'
compdef _git gcp=git-cherry-pick
-alias glg='git log --stat --max-count=5'
+alias glg='git log --stat --max-count=10'
compdef _git glg=git-log
-alias glgg='git log --graph --max-count=5'
+alias glgg='git log --graph --max-count=10'
compdef _git glgg=git-log
+alias glgga='git log --graph --decorate --all'
+compdef _git glgga=git-log
+alias glo='git log --oneline'
+compdef _git glo=git-log
alias gss='git status -s'
compdef _git gss=git-status
alias ga='git add'
@@ -38,6 +72,28 @@ alias gm='git merge'
compdef _git gm=git-merge
alias grh='git reset HEAD'
alias grhh='git reset HEAD --hard'
+alias gclean='git reset --hard && git clean -dfx'
+alias gwc='git whatchanged -p --abbrev-commit --pretty=medium'
+
+#remove the gf alias
+#alias gf='git ls-files | grep'
+
+alias gpoat='git push origin --all && git push origin --tags'
+alias gmt='git mergetool --no-prompt'
+compdef _git gm=git-mergetool
+
+alias gg='git gui citool'
+alias gga='git gui citool --amend'
+alias gk='gitk --all --branches'
+
+alias gsts='git stash show --text'
+alias gsta='git stash'
+alias gstp='git stash pop'
+alias gstd='git stash drop'
+
+# Will cd into the top of the current repository
+# or submodule.
+alias grt='cd $(git rev-parse --show-toplevel || echo ".")'
# Git and svn mix
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
@@ -50,20 +106,55 @@ alias gsd='git svn dcommit'
# Usage example: git pull origin $(current_branch)
#
function current_branch() {
- ref=$(git symbolic-ref HEAD 2> /dev/null) || return
+ ref=$(git symbolic-ref HEAD 2> /dev/null) || \
+ ref=$(git rev-parse --short HEAD 2> /dev/null) || return
echo ${ref#refs/heads/}
}
function current_repository() {
-
- ref=$(git symbolic-ref HEAD 2> /dev/null) || return
+ ref=$(git symbolic-ref HEAD 2> /dev/null) || \
+ ref=$(git rev-parse --short HEAD 2> /dev/null) || return
echo $(git remote -v | cut -d':' -f 2)
}
# these aliases take advantage of the previous function
alias ggpull='git pull origin $(current_branch)'
compdef ggpull=git
+alias ggpur='git pull --rebase origin $(current_branch)'
+compdef ggpur=git
alias ggpush='git push origin $(current_branch)'
compdef ggpush=git
alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
compdef ggpnp=git
+
+# Pretty log messages
+function _git_log_prettily(){
+ if ! [ -z $1 ]; then
+ git log --pretty=$1
+ fi
+}
+alias glp="_git_log_prettily"
+compdef _git glp=git-log
+
+# Work In Progress (wip)
+# These features allow to pause a branch development and switch to another one (wip)
+# When you want to go back to work, just unwip it
+#
+# This function return a warning if the current branch is a wip
+function work_in_progress() {
+ if $(git log -n 1 2>/dev/null | grep -q -c wip); then
+ echo "WIP!!"
+ fi
+}
+# these alias commit and uncomit wip branches
+alias gwip='git add -A; git ls-files --deleted -z | xargs -0 git rm; git commit -m "wip"'
+alias gunwip='git log -n 1 | grep -q -c wip && git reset HEAD~1'
+
+# these alias ignore changes to file
+alias gignore='git update-index --assume-unchanged'
+alias gunignore='git update-index --no-assume-unchanged'
+# list temporarily ignored files
+alias gignored='git ls-files -v | grep "^[[:lower:]]"'
+
+
+
View
18 home/.oh-my-zsh/plugins/github/github.plugin.zsh
@@ -1,5 +1,22 @@
# Setup hub function for git, if it is available; http://github.com/defunkt/hub
if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then
+ # Autoload _git completion functions
+ if declare -f _git > /dev/null; then
+ _git
+ fi
+
+ if declare -f _git_commands > /dev/null; then
+ _hub_commands=(
+ 'alias:show shell instructions for wrapping git'
+ 'pull-request:open a pull request on GitHub'
+ 'fork:fork origin repo on GitHub'
+ 'create:create new repo on GitHub for the current project'
+ 'browse:browse the project on GitHub'
+ 'compare:open GitHub compare view'
+ )
+ # Extend the '_git_commands' function with hub commands
+ eval "$(declare -f _git_commands | sed -e 's/base_commands=(/base_commands=(${_hub_commands} /')"
+ fi
# eval `hub alias -s zsh`
function git(){
if ! (( $+_has_working_hub )); then
@@ -61,6 +78,7 @@ exist_gh() { # [DIRECTORY]
cd "$1"
name=$( git config user.name )
ghuser=$( git config github.user )
+ repo=$1
git remote add origin git@github.com:${ghuser}/${repo}.git
git push -u origin master
View
51 home/.oh-my-zsh/plugins/gpg-agent/gpg-agent.plugin.zsh
@@ -1,26 +1,41 @@
-# Based on ssh-agent code
-
local GPG_ENV=$HOME/.gnupg/gpg-agent.env
-function start_agent {
- /usr/bin/env gpg-agent --daemon --enable-ssh-support --write-env-file ${GPG_ENV} > /dev/null
- chmod 600 ${GPG_ENV}
- . ${GPG_ENV} > /dev/null
+function start_agent_nossh {
+ eval $(/usr/bin/env gpg-agent --quiet --daemon --write-env-file ${GPG_ENV} 2> /dev/null)
+ chmod 600 ${GPG_ENV}
+ export GPG_AGENT_INFO
}
-# Source GPG agent settings, if applicable
-if [ -f "${GPG_ENV}" ]; then
- . ${GPG_ENV} > /dev/null
- ps -ef | grep ${SSH_AGENT_PID} | grep gpg-agent > /dev/null || {
- start_agent;
- }
-else
- start_agent;
-fi
+function start_agent_withssh {
+ eval $(/usr/bin/env gpg-agent --quiet --daemon --enable-ssh-support --write-env-file ${GPG_ENV} 2> /dev/null)
+ chmod 600 ${GPG_ENV}
+ export GPG_AGENT_INFO
+ export SSH_AUTH_SOCK
+ export SSH_AGENT_PID
+}
-export GPG_AGENT_INFO
-export SSH_AUTH_SOCK
-export SSH_AGENT_PID
+# check if another agent is running
+if ! gpg-connect-agent --quiet /bye > /dev/null 2> /dev/null; then
+ # source settings of old agent, if applicable
+ if [ -f "${GPG_ENV}" ]; then
+ . ${GPG_ENV} > /dev/null
+ export GPG_AGENT_INFO
+ export SSH_AUTH_SOCK
+ export SSH_AGENT_PID
+ fi
+
+ # check again if another agent is running using the newly sourced settings
+ if ! gpg-connect-agent --quiet /bye > /dev/null 2> /dev/null; then
+ # check for existing ssh-agent
+ if ssh-add -l > /dev/null 2> /dev/null; then
+ # ssh-agent running, start gpg-agent without ssh support
+ start_agent_nossh;
+ else
+ # otherwise start gpg-agent with ssh support
+ start_agent_withssh;
+ fi
+ fi
+fi
GPG_TTY=$(tty)
export GPG_TTY
View
19 home/.oh-my-zsh/plugins/gradle/gradle.plugin.zsh
@@ -54,27 +54,14 @@ function in_gradle() {
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
+ [ ! -f .gradletasknamecache ] && return 0;
+ [ .gradletasknamecache -nt build.gradle ] && return 0;
+ return 1;
}
View
28 home/.oh-my-zsh/plugins/grails/grails.plugin.zsh
@@ -24,17 +24,23 @@ _enumerateGrailsScripts() {
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
+ scripts=()
+ for file in $files
+ do
+ # - Strip the path
+ # - Remove all scripts with a leading '_'
+ # - PackagePlugin_.groovy -> PackagePlugin
+ # - PackagePlugin -> Package-Plugin
+ # - Package-Plugin -> package-plugin
+ command=$(basename $file \
+ | sed -E -e 's/^_?([^_]+)_?.groovy/\1/'\
+ -e 's/([a-z])([A-Z])/\1-\2/g' \
+ | tr "[:upper:]" "[:lower:]" \
+ | sort \
+ | uniq)
+ scripts+=($command)
+ done
+ echo $scripts
}
_grails() {
View
7 home/.oh-my-zsh/plugins/heroku/_heroku
@@ -23,8 +23,10 @@ _1st_arguments=(
"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"
+ "config\:pull":"pull heroku config vars down to the local environment"
+ "config\:push":"push local config vars to heroku"
+ "config\:set":"set one or more config vars"
+ "config\:unset":"unset one or more config vars"
"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"
@@ -154,5 +156,6 @@ case "$words[1]" in
_arguments \
$_command_args \
'(--app)--app[the app name]' \
+ '(--remote)--remote[the remote name]' \
&& return 0
View
41 home/.oh-my-zsh/plugins/jira/jira.plugin.zsh
@@ -1,20 +1,43 @@
# To use: add a .jira-url file in the base of your project
+# You can also set JIRA_URL in your .zshrc or put .jira-url in your home directory
+# .jira-url in the current directory takes precedence
+#
+# If you use Rapid Board, set:
+#JIRA_RAPID_BOARD="true"
+# in you .zshrc
+#
# Setup: cd to/my/project
# echo "https://name.jira.com" >> .jira-url
# Usage: jira # opens a new issue
# jira ABC-123 # Opens an existing issue
open_jira_issue () {
- if [ ! -f .jira-url ]; then
- echo "There is no .jira-url file in the current directory..."
- return 0;
+ local open_cmd
+ if [[ $(uname -s) == 'Darwin' ]]; then
+ open_cmd='open'
else
- jira_url=$(cat .jira-url);
- if [ -z "$1" ]; then
- echo "Opening new issue";
- `open $jira_url/secure/CreateIssue!default.jspa`;
+ open_cmd='xdg-open'
+ fi
+
+ if [ -f .jira-url ]; then
+ jira_url=$(cat .jira-url)
+ elif [ -f ~/.jira-url ]; then
+ jira_url=$(cat ~/.jira-url)
+ elif [[ "x$JIRA_URL" != "x" ]]; then
+ jira_url=$JIRA_URL
+ else
+ echo "JIRA url is not specified anywhere."
+ return 0
+ fi
+
+ if [ -z "$1" ]; then
+ echo "Opening new issue"
+ $open_cmd "$jira_url/secure/CreateIssue!default.jspa"
+ else
+ echo "Opening issue #$1"
+ if [[ "x$JIRA_RAPID_BOARD" = "xtrue" ]]; then
+ $open_cmd "$jira_url/issues/$1"
else
- echo "Opening issue #$1";
- `open $jira_url/issues/$1`;
+ $open_cmd "$jira_url/browse/$1"
fi
fi
}
View
25 home/.oh-my-zsh/plugins/knife/_knife
@@ -1,5 +1,10 @@
#compdef knife
+# You can override the path to knife.rb and your cookbooks by setting
+# KNIFE_CONF_PATH=/path/to/my/.chef/knife.rb
+# KNIFE_COOKBOOK_PATH=/path/to/my/chef/cookbooks
+# Read around where these are used for more detail.
+
# These flags should be available everywhere according to man knife
knife_general_flags=( --help --server-url --key --config --editor --format --log_level --logfile --no-editor --user --print-after --version --yes )
@@ -26,7 +31,7 @@ _knife() {
case $state in
knifecmd)
- compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec environment index node recipe role search ssh status windows $cloudproviders
+ compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" diff exec environment index node recipe role search ssh status upload windows $cloudproviders
;;
knifesubcmd)
case $words[2] in
@@ -42,9 +47,12 @@ _knife() {
cookbook)
compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload
;;
- environment)
+ diff)
+ _arguments '*:file or directory:_files -g "*"'
+ ;;
+ environment)
compadd -Q "$@" list create delete edit show "from file"
- ;;
+ ;;
node)
compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete"
;;
@@ -54,6 +62,9 @@ _knife() {
role)
compadd -Q "$@" "bulk delete" create delete edit "from file" list show
;;
+ upload)
+ _arguments '*:file or directory:_files -g "*"'
+ ;;
windows)
compadd "$@" bootstrap
;;
@@ -170,7 +181,13 @@ _chef_environments_remote() {
# The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server
_chef_cookbooks_local() {
- (for i in $( grep cookbook_path $HOME/.chef/knife.rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' ); do ls $i; done)
+
+ local knife_rb=${KNIFE_CONF_PATH:-${HOME}/.chef/knife.rb}
+ if [ -f ./.chef/knife.rb ]; then
+ knife_rb="./.chef/knife.rb"
+ fi
+ local cookbook_path=${KNIFE_COOKBOOK_PATH:-$(grep cookbook_path $knife_rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' )}
+ (for i in $cookbook_path; do ls $i; done)
}
# This function extracts the available cookbook versions on the chef server
View
14 home/.oh-my-zsh/plugins/lein/lein.plugin.zsh
@@ -5,15 +5,29 @@ function _lein_commands() {
case $state in
subcommand)
subcommands=(
+ "classpath:print the classpath of the current project"
"clean:remove compiled files and dependencies from project"
"compile:ahead-of-time compile the project"
+ "deploy:build jar and deploy to remote repository"
"deps:download and install all dependencies"
"help:display a list of tasks or help for a given task"
"install:install the project and its dependencies in your local repository"
+ "int:enter an interactive task shell"
+ "interactive:enter an interactive task shell"
+ "jack-in:jack in to a clojure slime session from emacs."
"jar:create a jar file containing the compiled .class files"
+ "javac:compile java source files"
"new:create a new project skeleton"
+ "plugin:manage user-level plugins"
"pom:write a pom.xml file to disk for maven interop"
+ "repl:start a repl session either with the current project or standalone"
+ "retest:run only the test namespaces which failed last time around"
+ "run:run the project's -main function"
+ "search:search remote maven repositories for matching jars"
+ "swank:launch swank server for Emacs to connect"
"test:run the project's tests"
+ "test!:run a project's tests after cleaning and fetching dependencies"
+ "trampoline:run a task without nesting the project's JVM inside Leiningen's."
"uberjar:Create a jar including the contents of each of deps"
"upgrade:upgrade leiningen to the latest stable release"
"version:print leiningen's version"
View
1  home/.oh-my-zsh/plugins/lol/lol.plugin.zsh
@@ -5,6 +5,7 @@ alias wtf='dmesg'
alias onoz='cat /var/log/errors.log'
alias rtfm='man'
+alias :3='echo'
alias visible='echo'
alias invisible='cat'
alias moar='more'
View
52 home/.oh-my-zsh/plugins/mercurial/mercurial.plugin.zsh
@@ -1,14 +1,64 @@
-
# Mercurial
alias hgc='hg commit'
alias hgb='hg branch'
alias hgba='hg branches'
+alias hgbk='hg bookmarks'
alias hgco='hg checkout'
alias hgd='hg diff'