mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-14 01:40:09 +00:00
Merge branch 'master' of git://github.com/robbyrussell/oh-my-zsh into taskwarrior-plugin
This commit is contained in:
commit
8411a39a86
31 changed files with 598 additions and 29 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,6 +2,7 @@ locals.zsh
|
|||
log/.zsh_history
|
||||
projects.zsh
|
||||
custom/*
|
||||
!custom/example
|
||||
!custom/example.zsh
|
||||
cache
|
||||
*.swp
|
||||
|
|
|
@ -48,7 +48,9 @@ the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty fo
|
|||
h3. Customization
|
||||
|
||||
If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory.
|
||||
If you have many functions which go good together you can put them as a *.plugin.zsh file in the @plugin/@ directory and then enable this plugin.
|
||||
If you have many functions which go good 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. Uninstalling
|
||||
|
||||
|
@ -68,4 +70,4 @@ This project wouldn't exist without all of our awesome users and contributors.
|
|||
|
||||
* "View our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors
|
||||
|
||||
Thank you so much!
|
||||
Thank you so much!
|
||||
|
|
2
custom/example/example.plugin.zsh
Normal file
2
custom/example/example.plugin.zsh
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Add your own custom plugins in the custom/plugins directory. Plugins placed
|
||||
# here will override ones with the same name in the main plugins directory.
|
|
@ -29,7 +29,7 @@ function extract() {
|
|||
*.tar.xz) tar xvJf $1;;
|
||||
*.tar.lzma) tar --lzma -xvf $1;;
|
||||
*.bz2) bunzip $1;;
|
||||
*.rar) unrar $1;;
|
||||
*.rar) unrar x $1;;
|
||||
*.gz) gunzip $1;;
|
||||
*.tar) tar xvf $1;;
|
||||
*.tbz2) tar xvjf $1;;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Initializes Oh My Zsh
|
||||
|
||||
# add a function path
|
||||
fpath=($ZSH/functions $fpath)
|
||||
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
|
||||
|
@ -17,7 +17,9 @@ compinit -i
|
|||
|
||||
# Load all of the plugins that were defined in ~/.zshrc
|
||||
for plugin ($plugins); do
|
||||
if [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
|
||||
if [ -f $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh ]; then
|
||||
source $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh
|
||||
elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
|
||||
source $ZSH/plugins/$plugin/$plugin.plugin.zsh
|
||||
fi
|
||||
done
|
||||
|
@ -31,7 +33,7 @@ if [ "$ZSH_THEME" = "random" ]
|
|||
then
|
||||
themes=($ZSH/themes/*zsh-theme)
|
||||
N=${#themes[@]}
|
||||
((N=RANDOM%N))
|
||||
((N=(RANDOM%N)+1))
|
||||
RANDOM_THEME=${themes[$N]}
|
||||
source "$RANDOM_THEME"
|
||||
echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
|
||||
|
|
26
plugins/ant/ant.plugin.zsh
Normal file
26
plugins/ant/ant.plugin.zsh
Normal file
|
@ -0,0 +1,26 @@
|
|||
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 -f%m .ant_targets)
|
||||
changed=$($stat_cmd -f%m build.xml)
|
||||
return $(expr $accurate '>=' $changed)
|
||||
fi
|
||||
}
|
||||
|
||||
_ant () {
|
||||
if [ -f build.xml ]; then
|
||||
if _ant_does_target_list_need_generating; then
|
||||
sed -n '/<target/s/<target.*name="\([^"]*\).*$/\1/p' build.xml > .ant_targets
|
||||
fi
|
||||
compadd `cat .ant_targets`
|
||||
fi
|
||||
}
|
||||
|
||||
compdef _ant ant
|
3
plugins/autojump/autojump.plugin.zsh
Normal file
3
plugins/autojump/autojump.plugin.zsh
Normal file
|
@ -0,0 +1,3 @@
|
|||
if [ -f `brew --prefix`/etc/autojump ]; then
|
||||
. `brew --prefix`/etc/autojump
|
||||
fi
|
|
@ -25,10 +25,12 @@ _1st_arguments=(
|
|||
'link:link a formula'
|
||||
'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.'
|
||||
'outdated:list formulas for which a newer version is available'
|
||||
'prune:remove dead links'
|
||||
'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)'
|
||||
'unlink:unlink a formula'
|
||||
'update:freshen up links'
|
||||
'upgrade:upgrade outdated formulae'
|
||||
|
@ -36,10 +38,14 @@ _1st_arguments=(
|
|||
)
|
||||
|
||||
local expl
|
||||
local -a formula installed_formulae
|
||||
local -a formulae installed_formulae
|
||||
|
||||
_arguments \
|
||||
'(-v --verbose)'{-v,--verbose}'[verbose]' \
|
||||
'(-v)-v[verbose]' \
|
||||
'(--cellar)--cellar[brew cellar]' \
|
||||
'(--config)--config[brew configuration]' \
|
||||
'(--env)--env[brew environment]' \
|
||||
'(--repository)--repository[brew repository]' \
|
||||
'(--version)--version[version information]' \
|
||||
'(--prefix)--prefix[where brew lives on this system]' \
|
||||
'(--cache)--cache[brew cache]' \
|
||||
|
@ -51,20 +57,24 @@ if (( CURRENT == 1 )); then
|
|||
fi
|
||||
|
||||
case "$words[1]" in
|
||||
list)
|
||||
search|-S)
|
||||
_arguments \
|
||||
'(--macports)--macports[search the macports repository]' \
|
||||
'(--fink)--fink[search the fink repository]' ;;
|
||||
list|ls)
|
||||
_arguments \
|
||||
'(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
|
||||
'(--versions)--versions[list all installed versions of a formula]' \
|
||||
'1: :->forms' && return 0
|
||||
|
||||
if [[ "$state" == forms ]]; then
|
||||
_brew_installed_formulae
|
||||
_requested installed_formulae expl 'installed formulae' compadd -a installed_formulae
|
||||
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
|
||||
fi ;;
|
||||
install|home|log|info|uses|cat|deps)
|
||||
install|home|homepage|log|info|abv|uses|cat|deps|edit|options)
|
||||
_brew_all_formulae
|
||||
_wanted formulae expl 'all formulae' compadd -a formulae ;;
|
||||
remove|edit|xo)
|
||||
remove|rm|uninstall|unlink|cleanup|link|ln)
|
||||
_brew_installed_formulae
|
||||
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
|
||||
esac
|
||||
|
||||
|
|
13
plugins/brew/brew.plugin.zsh
Normal file
13
plugins/brew/brew.plugin.zsh
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Move /usr/local/bin (path where brews are linked) to the front of the path
|
||||
# This will allow us to override system binaries like ruby with our brews
|
||||
# TODO: Do this in a more compatible way.
|
||||
# What if someone doesn't have /usr/bin in their path?
|
||||
export PATH=`echo $PATH | sed -e 's|/usr/local/bin||' -e 's|::|:|g'` # Remove /usr/local/bin
|
||||
export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/bin:&|'` # Add it in front of /usr/bin
|
||||
export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/sbin:&|'` # Add /usr/local/sbin
|
||||
|
||||
alias brews='brew list -1'
|
||||
|
||||
function brew-link-completion {
|
||||
ln -s "$(brew --prefix)/Library/Contributions/brew_zsh_completion.zsh" "$ZSH/plugins/brew/_brew.official"
|
||||
}
|
|
@ -18,4 +18,4 @@ function _cap () {
|
|||
fi
|
||||
}
|
||||
|
||||
compctl -K _cap cap
|
||||
compctl -K _cap cap
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
# VERSION: 1.0.0
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
if (( ${+commands[compleat]} )); then
|
||||
local prefix="${commands[compleat]:h:h}"
|
||||
local setup="${prefix}/share/compleat-1.0/compleat_setup"
|
||||
|
@ -19,4 +18,3 @@ if (( ${+commands[compleat]} )); then
|
|||
source "$setup"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
@ -4,4 +4,3 @@ if [ "$commands[(I)hub]" ]; then
|
|||
# eval `hub alias -s zsh`
|
||||
function git(){hub "$@"}
|
||||
fi
|
||||
|
||||
|
|
26
plugins/gpg-agent/gpg-agent.plugin.zsh
Normal file
26
plugins/gpg-agent/gpg-agent.plugin.zsh
Normal file
|
@ -0,0 +1,26 @@
|
|||
# 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
|
||||
}
|
||||
|
||||
# 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
|
||||
|
||||
export GPG_AGENT_INFO
|
||||
export SSH_AUTH_SOCK
|
||||
export SSH_AGENT_PID
|
||||
|
||||
GPG_TTY=$(tty)
|
||||
export GPG_TTY
|
8
plugins/node/node.plugin.zsh
Normal file
8
plugins/node/node.plugin.zsh
Normal file
|
@ -0,0 +1,8 @@
|
|||
# This works if you installed node via homebrew.
|
||||
export NODE_PATH="/usr/local/lib/node"
|
||||
|
||||
# Open the node api for your current version to the optional section.
|
||||
# TODO: Make the section part easier to use.
|
||||
function node-api {
|
||||
open "http://nodejs.org/docs/$(node --version)/api/all.html#$1"
|
||||
}
|
2
plugins/npm/npm.plugin.zsh
Normal file
2
plugins/npm/npm.plugin.zsh
Normal file
|
@ -0,0 +1,2 @@
|
|||
# TODO: Don't do this in such a weird way.
|
||||
export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/share/npm/bin:&|'`
|
|
@ -1,3 +1,9 @@
|
|||
alias showfiles='defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder'
|
||||
alias hidefiles='defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder'
|
||||
|
||||
# Recursively delete .DS_Store files
|
||||
alias rm-dsstore="find . -name '*.DS_Store' -type f -delete"
|
||||
|
||||
function savepath() {
|
||||
pwd > ~/.current_path~
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@ _phing_does_target_list_need_generating () {
|
|||
_phing () {
|
||||
if [ -f build.xml ]; then
|
||||
if _phing_does_target_list_need_generating; then
|
||||
echo "\nGenerating .phing_targets..." > /dev/stderr
|
||||
phing -l |grep -v ":" |grep -v "^$"|grep -v "\-" > .phing_targets
|
||||
fi
|
||||
compadd `cat .phing_targets`
|
||||
|
|
10
plugins/pow/pow.plugin.zsh
Normal file
10
plugins/pow/pow.plugin.zsh
Normal file
|
@ -0,0 +1,10 @@
|
|||
# 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
|
||||
}
|
||||
|
||||
compctl -W ~/.pow -/ kapow
|
|
@ -1,4 +1,6 @@
|
|||
# TODO: Make this compatible with rvm.
|
||||
# Run sudo gem on the system ruby, not the active ruby.
|
||||
alias sgem='sudo gem'
|
||||
|
||||
# Find ruby file
|
||||
alias rfind='find . -name *.rb | xargs grep -n'
|
||||
alias rfind='find . -name *.rb | xargs grep -n'
|
||||
|
|
147
plugins/rvm/_rvm
Normal file
147
plugins/rvm/_rvm
Normal file
|
@ -0,0 +1,147 @@
|
|||
#compdef rvm
|
||||
|
||||
local curcontext="$curcontext" state line cmds ret=1
|
||||
|
||||
_arguments -C \
|
||||
'(- 1 *)'{-v,--version}'[display version information]' \
|
||||
'(-l|--level)'{-l,--level}'+[patch level to use with rvm use / install]:number' \
|
||||
'(--prefix)--prefix[path for all rvm files (~/.rvm/), with trailing slash!]:path:_files' \
|
||||
'(--bin)--bin[path for binaries to be placed (~/.rvm/bin/)]:path:_files' \
|
||||
'(--source)--source[src directory to use (~/.rvm/src/)]:path:_files' \
|
||||
'(--archives)--archives[directory for downladed files (~/.rvm/archives/)]:path:_files' \
|
||||
'-S[Specify a script file to attempt to load and run (rubydo)]:file:_files' \
|
||||
'-e[Execute code from the command line]:code' \
|
||||
'(-G)-G[root gem path to use]:path:_files' \
|
||||
'(--gems)--gems[Used to set the gems_flag, use with remove to remove gems]' \
|
||||
'(--archive)--archive[Used to set the archive_flag, use with remove to remove archive]' \
|
||||
'(--patch)--patch[With MRI Rubies you may specify one or more full paths to patches]' \
|
||||
'(-C|--configure)'{-C,--configure}'=[custom configure options]' \
|
||||
'(--nice)--nice[process niceness (for slow computers, default 0)]:number' \
|
||||
'(--ree)--ree-options[Options passed directly to ree ./installer on the command line]:options' \
|
||||
'(--head)--head[with update, updates rvm to git head version]' \
|
||||
'(--rubygems)--rubygems[with update, updates rubygems for selected ruby]' \
|
||||
'(--default)--default[with ruby select, sets a default ruby for new shells]' \
|
||||
'(--debug)--debug[Toggle debug mode on for very verbose output]' \
|
||||
'(--trace)--trace[Toggle trace mode on to see EVERYTHING rvm is doing]' \
|
||||
'(--force)--force[Force install, removes old install & source before install]' \
|
||||
'(--summary)--summary[Used with rubydo to print out a summary of the commands run]' \
|
||||
'(--latest)--latest[with gemset --dump skips version strings for latest gem]' \
|
||||
'(--gems)--gems[with uninstall/remove removes gems with the interpreter]' \
|
||||
'(--docs)--docs[with install, attempt to generate ri after installation]' \
|
||||
'(--reconfigure)--reconfigure[Force ./configure on install even if Makefile already exists]' \
|
||||
'1: :->cmds' \
|
||||
'*: :->args' && ret=0
|
||||
|
||||
case $state in
|
||||
cmds)
|
||||
cmds=(
|
||||
"version:show the rvm version installed in rvm_path"
|
||||
"use:setup current shell to use a specific ruby version"
|
||||
"reload:reload rvm source itself (useful after changing rvm source)"
|
||||
"implode:(seppuku) removes the rvm installation completely. This means everything in $rvm_path (~/.rvm)."
|
||||
"update:upgrades rvm to the latest version."
|
||||
"reset:remove current and stored default & system settings."
|
||||
"info :show the *current* environment information for current ruby"
|
||||
"current:print the *current* ruby version and the name of any gemset being used."
|
||||
"debug:show info plus additional information for common issues"
|
||||
"install:install one or many ruby versions"
|
||||
"uninstall:uninstall one or many ruby versions, leaves their sources"
|
||||
"remove:uninstall one or many ruby versions and remove their sources"
|
||||
"migrate:Lets you migrate all gemsets from one ruby to another."
|
||||
"upgrade:Lets you upgrade from one version of a ruby to another, including migrating your gemsets semi-automatically."
|
||||
"wrapper:generates a set of wrapper executables for a given ruby with the specified ruby and gemset combination. Used under the hood for passenger support and the like."
|
||||
"cleanup:Lets you remove stale source folders / archives and other miscellaneous data associated with rvm."
|
||||
"repair:Lets you repair parts of your environment e.g. wrappers, env files and and similar files (e.g. general maintenance)."
|
||||
"snapshot:Lets your backup / restore an rvm installation in a lightweight manner."
|
||||
"disk-usage:Tells you how much disk space rvm install is using."
|
||||
"tools:Provides general information about the ruby environment, primarily useful when scripting rvm."
|
||||
"docs:Tools to make installing ri and rdoc documentation easier."
|
||||
"rvmrc:Tools related to managing rvmrc trust and loading."
|
||||
"exec:runs an arbitrary command as a set operation."
|
||||
"ruby:runs a named ruby file against specified and/or all rubies"
|
||||
"gem:runs a gem command using selected ruby's 'gem'"
|
||||
"rake:runs a rake task against specified and/or all rubies"
|
||||
"tests:runs 'rake test' across selected ruby versions"
|
||||
"specs:runs 'rake spec' across selected ruby versions"
|
||||
"monitor:Monitor cwd for testing, run rake {spec,test} on changes."
|
||||
"gemset:gemsets: http://rvm.beginrescueend.com/gemsets/"
|
||||
"rubygems:Switches the installed version of rubygems for the current ruby."
|
||||
"gemdir:display the path to the current gem directory (GEM_HOME)."
|
||||
"srcdir:display the path to rvm source directory (may be yanked)"
|
||||
"fetch:Performs an archive / src fetch only of the selected ruby."
|
||||
"list:show currently installed rubies, interactive output."
|
||||
"package:Install a dependency package {readline,iconv,zlib,openssl}"
|
||||
"notes:Display notes, with operating system specifics."
|
||||
"export:Temporarily set an environment variable in the current shell."
|
||||
"unexport:Undo changes made to the environment by 'rvm export'."
|
||||
)
|
||||
_describe -t commands 'rvm command' cmds && ret=0
|
||||
;;
|
||||
args)
|
||||
case $line[1] in
|
||||
(use|uninstall|remove|list)
|
||||
_values -S , 'rubies' $(rvm list strings | sed -e 's/ruby-\([^) ]*\)-\([^) ]*\)/ruby-\1-\2 \1-\2 \1/g') default system && ret=0
|
||||
;;
|
||||
(install|fetch)
|
||||
_values -S , 'rubies' $(rvm list known_strings) && ret=0
|
||||
;;
|
||||
gemset)
|
||||
if (( CURRENT == 3 )); then
|
||||
_values 'gemset_commands' \
|
||||
'import' \
|
||||
'export' \
|
||||
'create' \
|
||||
'copy' \
|
||||
'rename' \
|
||||
'empty' \
|
||||
'delete' \
|
||||
'name' \
|
||||
'dir' \
|
||||
'list' \
|
||||
'list_all' \
|
||||
'gemdir' \
|
||||
'install' \
|
||||
'pristine' \
|
||||
'clear' \
|
||||
'use' \
|
||||
'update' \
|
||||
'unpack' \
|
||||
'globalcache'
|
||||
else
|
||||
_values -S , 'gemsets' $(rvm gemset list | grep -v gemset 2>/dev/null)
|
||||
fi
|
||||
ret=0
|
||||
;;
|
||||
package)
|
||||
if (( CURRENT == 3 )); then
|
||||
_values 'package_commands' \
|
||||
'install' \
|
||||
'uninstall'
|
||||
else
|
||||
_values 'packages' \
|
||||
'readline' \
|
||||
'iconv' \
|
||||
'curl' \
|
||||
'openssl' \
|
||||
'zlib' \
|
||||
'autoconf' \
|
||||
'ncurses' \
|
||||
'pkgconfig' \
|
||||
'gettext' \
|
||||
'glib' \
|
||||
'mono' \
|
||||
'llvm' \
|
||||
'libxml2' \
|
||||
'libxslt' \
|
||||
'libyaml'
|
||||
fi
|
||||
ret=0
|
||||
;;
|
||||
*)
|
||||
(( ret )) && _message 'no more arguments'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
52
plugins/rvm/rvm.plugin.zsh
Normal file
52
plugins/rvm/rvm.plugin.zsh
Normal file
|
@ -0,0 +1,52 @@
|
|||
fpath=($ZSH/plugins/rvm $fpath)
|
||||
autoload -U compinit
|
||||
compinit -i
|
||||
|
||||
alias rubies='rvm list rubies'
|
||||
alias gemsets='rvm gemset list'
|
||||
|
||||
local ruby18='ruby-1.8.7-p334'
|
||||
local ruby19='ruby-1.9.2-p180'
|
||||
|
||||
function rb18 {
|
||||
if [ -z "$1" ]; then
|
||||
rvm use "$ruby18"
|
||||
else
|
||||
rvm use "$ruby18@$1"
|
||||
fi
|
||||
}
|
||||
|
||||
_rb18() {compadd `ls -1 $rvm_path/gems | grep "^$ruby18@" | sed -e "s/^$ruby18@//" | awk '{print $1}'`}
|
||||
compdef _rb18 rb18
|
||||
|
||||
function rb19 {
|
||||
if [ -z "$1" ]; then
|
||||
rvm use "$ruby19"
|
||||
else
|
||||
rvm use "$ruby19@$1"
|
||||
fi
|
||||
}
|
||||
|
||||
_rb19() {compadd `ls -1 $rvm_path/gems | grep "^$ruby19@" | sed -e "s/^$ruby19@//" | awk '{print $1}'`}
|
||||
compdef _rb19 rb19
|
||||
|
||||
function rvm-update {
|
||||
rvm get head
|
||||
rvm reload # TODO: Reload rvm completion?
|
||||
}
|
||||
|
||||
function rvm-link-completion {
|
||||
ln -s "$rvm_path/scripts/zsh/Completion/_rvm" "$ZSH/plugins/rvm/_rvm.official"
|
||||
}
|
||||
|
||||
# TODO: Make this usable w/o rvm.
|
||||
function gems {
|
||||
local current_ruby=`rvm-prompt i v p`
|
||||
local current_gemset=`rvm-prompt g`
|
||||
|
||||
gem list $@ | sed \
|
||||
-Ee "s/\([0-9\.]+( .+)?\)/$fg[blue]&$reset_color/g" \
|
||||
-Ee "s|$(echo $rvm_path)|$fg[magenta]\$rvm_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"
|
||||
}
|
|
@ -1,11 +1,9 @@
|
|||
alias et='mate .'
|
||||
alias ett='mate app config lib db public spec test Rakefile Capfile Todo'
|
||||
alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo'
|
||||
alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo'
|
||||
|
||||
# TextMate
|
||||
alias et='mate . &'
|
||||
alias ett='mate app config lib db public spec test Rakefile Capfile Todo &'
|
||||
alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
|
||||
alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
|
||||
|
||||
# Editor Ruby file in TextMate
|
||||
# Edit Ruby app in TextMate
|
||||
alias mr='mate CHANGELOG app config db lib public script spec test'
|
||||
|
||||
function tm() {
|
||||
|
|
4
plugins/thor/_thor
Normal file
4
plugins/thor/_thor
Normal file
|
@ -0,0 +1,4 @@
|
|||
#compdef thor
|
||||
#autoload
|
||||
|
||||
compadd `thor list | grep thor | cut -d " " -f 2`
|
|
@ -3,7 +3,18 @@
|
|||
local user_color='green'; [ $UID -eq 0 ] && user_color='red'
|
||||
PROMPT='%n@%m %{$fg[$user_color]%}%~%{$reset_color%}%(!.#.>) '
|
||||
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
||||
RPS1='%(?..%{$fg[red]%}%? ↵%{$reset_color%})$(git_prompt_info)'
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[cyan]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}"
|
||||
RPROMPT='${return_status}$(git_prompt_info)$(git_prompt_status)%{$reset_color%}'
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX=" "
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX=""
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY=""
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[green]%}+"
|
||||
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[blue]%}!"
|
||||
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%}-"
|
||||
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[magenta]%}>"
|
||||
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[yellow]%}#"
|
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[cyan]%}?"
|
||||
|
|
6
themes/fwalch.zsh-theme
Normal file
6
themes/fwalch.zsh-theme
Normal file
|
@ -0,0 +1,6 @@
|
|||
PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[red]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
|
15
themes/minimal.zsh-theme
Normal file
15
themes/minimal.zsh-theme
Normal file
|
@ -0,0 +1,15 @@
|
|||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[white]%}["
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}●%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||
|
||||
#Customized git status, oh-my-zsh currently does not allow render dirty status before branch
|
||||
git_custom_status() {
|
||||
local cb=$(current_branch)
|
||||
if [ -n "$cb" ]; then
|
||||
echo "- $ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
PROMPT='%2~ $(git_custom_status) »%b '
|
11
themes/obraun.zsh-theme
Normal file
11
themes/obraun.zsh-theme
Normal file
|
@ -0,0 +1,11 @@
|
|||
if [ "$(whoami)" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi
|
||||
|
||||
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||
|
||||
PROMPT='%{$fg[green]%}[%*]%{$reset_color%} %{$fg_no_bold[cyan]%}%n %{${fg_bold[blue]}%}::%{$reset_color%} %{$fg[yellow]%}%m%{$reset_color%} %{$fg_no_bold[magenta]%} ➜ %{$reset_color%} %{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}»%{${reset_color}%} '
|
||||
|
||||
RPS1="${return_code}"
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}‹"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}"
|
||||
|
15
themes/re5et.zsh-theme
Normal file
15
themes/re5et.zsh-theme
Normal file
|
@ -0,0 +1,15 @@
|
|||
if [ "$(whoami)" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="magenta"; fi
|
||||
|
||||
local return_code="%(?..%{$fg_bold[red]%}:( %?%{$reset_color%})"
|
||||
|
||||
PROMPT='
|
||||
%{$fg_bold[cyan]%}%n%{$reset_color%}%{$fg[yellow]%}@%{$reset_color%}%{$fg_bold[blue]%}%m%{$reset_color%}:%{${fg_bold[green]}%}%~%{$reset_color%}$(git_prompt_info)
|
||||
%{${fg[$CARETCOLOR]}%}%# %{${reset_color}%}'
|
||||
|
||||
RPS1='${return_code} %D - %*'
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[magenta]%}^%{$reset_color%}%{$fg_bold[yellow]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%} ±"
|
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ?"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[red]%} ♥"
|
6
themes/simple.zsh-theme
Normal file
6
themes/simple.zsh-theme
Normal file
|
@ -0,0 +1,6 @@
|
|||
PROMPT='%{$fg[green]%}%~%{$fg_bold[blue]%}$(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=" ✔"
|
100
themes/steeef.zsh-theme
Normal file
100
themes/steeef.zsh-theme
Normal file
|
@ -0,0 +1,100 @@
|
|||
# prompt style and colors based on Steve Losh's Prose theme:
|
||||
# http://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme
|
||||
#
|
||||
# vcs_info modifications from Bart Trojanowski's zsh prompt:
|
||||
# http://www.jukie.net/bart/blog/pimping-out-zsh-prompt
|
||||
#
|
||||
# git untracked files modification from Brian Carper:
|
||||
# http://briancarper.net/blog/570/git-info-in-your-zsh-prompt
|
||||
|
||||
function virtualenv_info {
|
||||
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
|
||||
}
|
||||
PR_GIT_UPDATE=1
|
||||
|
||||
setopt prompt_subst
|
||||
autoload colors
|
||||
colors
|
||||
|
||||
autoload -U add-zsh-hook
|
||||
autoload -Uz vcs_info
|
||||
|
||||
#use extended color pallete if available
|
||||
if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then
|
||||
turquoise="%F{81}"
|
||||
orange="%F{166}"
|
||||
purple="%F{135}"
|
||||
hotpink="%F{161}"
|
||||
limegreen="%F{118}"
|
||||
else
|
||||
turquoise="$fg[cyan]"
|
||||
orange="$fg[yellow]"
|
||||
purple="$fg[magenta]"
|
||||
hotpink="$fg[red]"
|
||||
limegreen="$fg[green]"
|
||||
fi
|
||||
|
||||
# enable VCS systems you use
|
||||
zstyle ':vcs_info:*' enable git svn
|
||||
|
||||
# check-for-changes can be really slow.
|
||||
# you should disable it, if you work with large repositories
|
||||
zstyle ':vcs_info:*:prompt:*' check-for-changes true
|
||||
|
||||
# set formats
|
||||
# %b - branchname
|
||||
# %u - unstagedstr (see below)
|
||||
# %c - stagedstr (see below)
|
||||
# %a - action (e.g. rebase-i)
|
||||
# %R - repository path
|
||||
# %S - path in the repository
|
||||
PR_RST="%{${reset_color}%}"
|
||||
FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})"
|
||||
FMT_ACTION="(%{$limegreen%}%a${PR_RST})"
|
||||
FMT_UNSTAGED="%{$orange%}●"
|
||||
FMT_STAGED="%{$limegreen%}●"
|
||||
|
||||
zstyle ':vcs_info:*:prompt:*' unstagedstr "${FMT_UNSTAGED}"
|
||||
zstyle ':vcs_info:*:prompt:*' stagedstr "${FMT_STAGED}"
|
||||
zstyle ':vcs_info:*:prompt:*' actionformats "${FMT_BRANCH}${FMT_ACTION}"
|
||||
zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}"
|
||||
zstyle ':vcs_info:*:prompt:*' nvcsformats ""
|
||||
|
||||
|
||||
function steeef_preexec {
|
||||
case "$(history $HISTCMD)" in
|
||||
*git*)
|
||||
PR_GIT_UPDATE=1
|
||||
;;
|
||||
*svn*)
|
||||
PR_GIT_UPDATE=1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
add-zsh-hook preexec steeef_preexec
|
||||
|
||||
function steeef_chpwd {
|
||||
PR_GIT_UPDATE=1
|
||||
}
|
||||
add-zsh-hook chpwd steeef_chpwd
|
||||
|
||||
function steeef_precmd {
|
||||
if [[ -n "$PR_GIT_UPDATE" ]] ; then
|
||||
# check for untracked files or updated submodules, since vcs_info doesn't
|
||||
if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then
|
||||
PR_GIT_UPDATE=1
|
||||
FMT_BRANCH="(%{$turquoise%}%b%u%c%{$hotpink%}●${PR_RST})"
|
||||
else
|
||||
FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})"
|
||||
fi
|
||||
zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}"
|
||||
|
||||
vcs_info 'prompt'
|
||||
PR_GIT_UPDATE=
|
||||
fi
|
||||
}
|
||||
add-zsh-hook precmd steeef_precmd
|
||||
|
||||
PROMPT=$'
|
||||
%{$purple%}%n%{$reset_color%} at %{$orange%}%m%{$reset_color%} in %{$limegreen%}%~%{$reset_color%} $vcs_info_msg_0_
|
||||
$(virtualenv_info)$ '
|
95
themes/trapd00r.zsh-theme
Normal file
95
themes/trapd00r.zsh-theme
Normal file
|
@ -0,0 +1,95 @@
|
|||
# Name: trapd00r zsh theme
|
||||
# Author: Magnus Woldrich <m@japh.se>
|
||||
#
|
||||
# This theme needs a terminal supporting 256 colors as well as unicode. It also
|
||||
# needs the script that splits up the current path and makes it fancy as located
|
||||
# here: https://github.com/trapd00r/utils/blob/master/zsh_path
|
||||
#
|
||||
# By default it spans over two lines like so:
|
||||
#
|
||||
# scp1@shiva:pts/9-> /home » scp1 (0)
|
||||
# >
|
||||
#
|
||||
# that's user@host:pts/-> splitted path (return status)
|
||||
#
|
||||
# If the current directory is a git repository, we span 3 lines;
|
||||
#
|
||||
# git❨ master ❩ DIRTY
|
||||
# scp1@shiva:pts/4-> /home » scp1 » dev » utils (0)
|
||||
# >
|
||||
|
||||
autoload -U add-zsh-hook
|
||||
autoload -Uz vcs_info
|
||||
|
||||
local c0=$( printf "\e[m")
|
||||
local c1=$( printf "\e[38;5;245m")
|
||||
local c2=$( printf "\e[38;5;250m")
|
||||
local c3=$( printf "\e[38;5;242m")
|
||||
local c4=$( printf "\e[38;5;197m")
|
||||
local c5=$( printf "\e[38;5;225m")
|
||||
local c6=$( printf "\e[38;5;240m")
|
||||
local c7=$( printf "\e[38;5;242m")
|
||||
local c8=$( printf "\e[38;5;244m")
|
||||
local c9=$( printf "\e[38;5;162m")
|
||||
local c10=$(printf "\e[1m")
|
||||
local c11=$(printf "\e[38;5;208m\e[1m")
|
||||
local c12=$(printf "\e[38;5;142m\e[1m")
|
||||
local c13=$(printf "\e[38;5;196m\e[1m")
|
||||
|
||||
|
||||
# We dont want to use the extended colorset in the TTY / VC.
|
||||
if [ "$TERM" = "linux" ]; then
|
||||
c1=$( printf "\e[34;1m")
|
||||
c2=$( printf "\e[35m")
|
||||
c3=$( printf "\e[31m")
|
||||
c4=$( printf "\e[31;1m")
|
||||
c5=$( printf "\e[32m")
|
||||
c6=$( printf "\e[32;1m")
|
||||
c7=$( printf "\e[33m")
|
||||
c8=$( printf "\e[33;1m")
|
||||
c9=$( printf "\e[34m")
|
||||
|
||||
c11=$(printf "\e[35;1m")
|
||||
c12=$(printf "\e[36m")
|
||||
c13=$(printf "\e[31;1m")
|
||||
fi
|
||||
|
||||
zstyle ':vcs_info:*' actionformats \
|
||||
'%{$c8%}(%f%s)%{$c7%}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
|
||||
|
||||
zstyle ':vcs_info:*' formats \
|
||||
"%{$c8%}%s%%{$c7%}❨ %{$c9%}%{$c11%}%b%{$c7%} ❩%{$reset_color%}%f "
|
||||
|
||||
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
|
||||
zstyle ':vcs_info:*' enable git
|
||||
|
||||
add-zsh-hook precmd prompt_jnrowe_precmd
|
||||
|
||||
prompt_jnrowe_precmd () {
|
||||
vcs_info
|
||||
if [ "${vcs_info_msg_0_}" = "" ]; then
|
||||
dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
|
||||
PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%}
|
||||
> '
|
||||
|
||||
# modified, to be commited
|
||||
elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then
|
||||
dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
|
||||
PROMPT='${vcs_info_msg_0_}%{$30%} %{$bg_bold[red]%}%{$fg_bold[cyan]%}C%{$fg_bold[black]%}OMMIT%{$reset_color%}
|
||||
%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%}
|
||||
> '
|
||||
|
||||
elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then
|
||||
dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
|
||||
PROMPT='${vcs_info_msg_0_}%{$bg_bold[red]%}%{$fg_bold[blue]%}D%{$fg_bold[black]%}IRTY%{$reset_color%}
|
||||
%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%}
|
||||
%{$c13%}>%{$c0%} '
|
||||
else
|
||||
dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
|
||||
PROMPT='${vcs_info_msg_0_}
|
||||
%{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%}
|
||||
> '
|
||||
fi
|
||||
}
|
||||
|
||||
# vim: set ft=zsh sw=2 et tw=0:
|
Loading…
Reference in a new issue