Conflicts:
README.textile
... | ... |
@@ -57,7 +57,7 @@ git_prompt_status() { |
57 | 57 |
if $(echo "$INDEX" | grep '^R ' &> /dev/null); then |
58 | 58 |
STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS" |
59 | 59 |
fi |
60 |
- if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then |
|
60 |
+ if $(echo "$INDEX" | grep '^D ' &> /dev/null); then |
|
61 | 61 |
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" |
62 | 62 |
fi |
63 | 63 |
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then |
... | ... |
@@ -1,7 +1,13 @@ |
1 |
+# Check for updates on initial load... |
|
2 |
+if [ "$DISABLE_AUTO_UPDATE" != "true" ] |
|
3 |
+then |
|
4 |
+ /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh |
|
5 |
+fi |
|
6 |
+ |
|
1 | 7 |
# Initializes Oh My Zsh |
2 | 8 |
|
3 | 9 |
# add a function path |
4 |
-fpath=($ZSH/functions $fpath) |
|
10 |
+fpath=($ZSH/functions $ZSH/completions $fpath) |
|
5 | 11 |
|
6 | 12 |
# Load all of the config files in ~/oh-my-zsh that end in .zsh |
7 | 13 |
# TIP: Add files you don't want in git to .gitignore |
... | ... |
@@ -17,7 +23,9 @@ compinit -i |
17 | 17 |
|
18 | 18 |
# Load all of the plugins that were defined in ~/.zshrc |
19 | 19 |
for plugin ($plugins); do |
20 |
- if [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then |
|
20 |
+ if [ -f $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh ]; then |
|
21 |
+ source $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh |
|
22 |
+ elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then |
|
21 | 23 |
source $ZSH/plugins/$plugin/$plugin.plugin.zsh |
22 | 24 |
fi |
23 | 25 |
done |
... | ... |
@@ -26,12 +34,11 @@ done |
26 | 26 |
for config_file ($ZSH/custom/*.zsh) source $config_file |
27 | 27 |
|
28 | 28 |
# Load the theme |
29 |
-# Check for updates on initial load... |
|
30 | 29 |
if [ "$ZSH_THEME" = "random" ] |
31 | 30 |
then |
32 | 31 |
themes=($ZSH/themes/*zsh-theme) |
33 | 32 |
N=${#themes[@]} |
34 |
- ((N=RANDOM%N)) |
|
33 |
+ ((N=(RANDOM%N)+1)) |
|
35 | 34 |
RANDOM_THEME=${themes[$N]} |
36 | 35 |
source "$RANDOM_THEME" |
37 | 36 |
echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..." |
... | ... |
@@ -39,11 +46,3 @@ else |
39 | 39 |
source "$ZSH/themes/$ZSH_THEME.zsh-theme" |
40 | 40 |
fi |
41 | 41 |
|
42 |
- |
|
43 |
-# Check for updates on initial load... |
|
44 |
-if [ "$DISABLE_AUTO_UPDATE" = "true" ] |
|
45 |
-then |
|
46 |
- return |
|
47 |
-else |
|
48 |
- /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh |
|
49 |
-fi |
50 | 42 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,26 @@ |
0 |
+stat -f%m . > /dev/null 2>&1 |
|
1 |
+if [ "$?" = 0 ]; then |
|
2 |
+ stat_cmd=(stat -f%m) |
|
3 |
+else |
|
4 |
+ stat_cmd=(stat -L --format=%Y) |
|
5 |
+fi |
|
6 |
+ |
|
7 |
+_ant_does_target_list_need_generating () { |
|
8 |
+ if [ ! -f .ant_targets ]; then return 0; |
|
9 |
+ else |
|
10 |
+ accurate=$($stat_cmd .ant_targets) |
|
11 |
+ changed=$($stat_cmd build.xml) |
|
12 |
+ return $(expr $accurate '>=' $changed) |
|
13 |
+ fi |
|
14 |
+} |
|
15 |
+ |
|
16 |
+_ant () { |
|
17 |
+ if [ -f build.xml ]; then |
|
18 |
+ if _ant_does_target_list_need_generating; then |
|
19 |
+ sed -n '/<target/s/<target.*name="\([^"]*\).*$/\1/p' build.xml > .ant_targets |
|
20 |
+ fi |
|
21 |
+ compadd `cat .ant_targets` |
|
22 |
+ fi |
|
23 |
+} |
|
24 |
+ |
|
25 |
+compdef _ant ant |
... | ... |
@@ -25,10 +25,12 @@ _1st_arguments=( |
25 | 25 |
'link:link a formula' |
26 | 26 |
'list:list files in a formula or not-installed formulae' |
27 | 27 |
'log:git commit log for a formula' |
28 |
+ 'missing:check all installed formuale for missing dependencies.' |
|
28 | 29 |
'outdated:list formulas for which a newer version is available' |
29 | 30 |
'prune:remove dead links' |
30 | 31 |
'remove:remove a formula' |
31 | 32 |
'search:search for a formula (/regex/ or string)' |
33 |
+ 'server:start a local web app that lets you browse formulae (requires Sinatra)' |
|
32 | 34 |
'unlink:unlink a formula' |
33 | 35 |
'update:freshen up links' |
34 | 36 |
'upgrade:upgrade outdated formulae' |
... | ... |
@@ -36,10 +38,14 @@ _1st_arguments=( |
36 | 36 |
) |
37 | 37 |
|
38 | 38 |
local expl |
39 |
-local -a formula installed_formulae |
|
39 |
+local -a formulae installed_formulae |
|
40 | 40 |
|
41 | 41 |
_arguments \ |
42 |
- '(-v --verbose)'{-v,--verbose}'[verbose]' \ |
|
42 |
+ '(-v)-v[verbose]' \ |
|
43 |
+ '(--cellar)--cellar[brew cellar]' \ |
|
44 |
+ '(--config)--config[brew configuration]' \ |
|
45 |
+ '(--env)--env[brew environment]' \ |
|
46 |
+ '(--repository)--repository[brew repository]' \ |
|
43 | 47 |
'(--version)--version[version information]' \ |
44 | 48 |
'(--prefix)--prefix[where brew lives on this system]' \ |
45 | 49 |
'(--cache)--cache[brew cache]' \ |
... | ... |
@@ -51,20 +57,24 @@ if (( CURRENT == 1 )); then |
51 | 51 |
fi |
52 | 52 |
|
53 | 53 |
case "$words[1]" in |
54 |
- list) |
|
54 |
+ search|-S) |
|
55 |
+ _arguments \ |
|
56 |
+ '(--macports)--macports[search the macports repository]' \ |
|
57 |
+ '(--fink)--fink[search the fink repository]' ;; |
|
58 |
+ list|ls) |
|
55 | 59 |
_arguments \ |
56 | 60 |
'(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \ |
61 |
+ '(--versions)--versions[list all installed versions of a formula]' \ |
|
57 | 62 |
'1: :->forms' && return 0 |
58 | 63 |
|
59 | 64 |
if [[ "$state" == forms ]]; then |
60 | 65 |
_brew_installed_formulae |
61 |
- _requested installed_formulae expl 'installed formulae' compadd -a installed_formulae |
|
66 |
+ _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae |
|
62 | 67 |
fi ;; |
63 |
- install|home|log|info|uses|cat|deps) |
|
68 |
+ install|home|homepage|log|info|abv|uses|cat|deps|edit|options) |
|
64 | 69 |
_brew_all_formulae |
65 | 70 |
_wanted formulae expl 'all formulae' compadd -a formulae ;; |
66 |
- remove|edit|xo) |
|
71 |
+ remove|rm|uninstall|unlink|cleanup|link|ln) |
|
67 | 72 |
_brew_installed_formulae |
68 | 73 |
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;; |
69 | 74 |
esac |
70 |
- |
... | ... |
@@ -5,7 +5,6 @@ |
5 | 5 |
# VERSION: 1.0.0 |
6 | 6 |
# ------------------------------------------------------------------------------ |
7 | 7 |
|
8 |
- |
|
9 | 8 |
if (( ${+commands[compleat]} )); then |
10 | 9 |
local prefix="${commands[compleat]:h:h}" |
11 | 10 |
local setup="${prefix}/share/compleat-1.0/compleat_setup" |
... | ... |
@@ -19,4 +18,3 @@ if (( ${+commands[compleat]} )); then |
19 | 19 |
source "$setup" |
20 | 20 |
fi |
21 | 21 |
fi |
22 |
- |
8 | 7 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,26 @@ |
0 |
+# Based on ssh-agent code |
|
1 |
+ |
|
2 |
+local GPG_ENV=$HOME/.gnupg/gpg-agent.env |
|
3 |
+ |
|
4 |
+function start_agent { |
|
5 |
+ /usr/bin/env gpg-agent --daemon --enable-ssh-support --write-env-file ${GPG_ENV} > /dev/null |
|
6 |
+ chmod 600 ${GPG_ENV} |
|
7 |
+ . ${GPG_ENV} > /dev/null |
|
8 |
+} |
|
9 |
+ |
|
10 |
+# Source GPG agent settings, if applicable |
|
11 |
+if [ -f "${GPG_ENV}" ]; then |
|
12 |
+ . ${GPG_ENV} > /dev/null |
|
13 |
+ ps -ef | grep ${SSH_AGENT_PID} | grep gpg-agent > /dev/null || { |
|
14 |
+ start_agent; |
|
15 |
+ } |
|
16 |
+else |
|
17 |
+ start_agent; |
|
18 |
+fi |
|
19 |
+ |
|
20 |
+export GPG_AGENT_INFO |
|
21 |
+export SSH_AUTH_SOCK |
|
22 |
+export SSH_AGENT_PID |
|
23 |
+ |
|
24 |
+GPG_TTY=$(tty) |
|
25 |
+export GPG_TTY |
... | ... |
@@ -1,3 +1,9 @@ |
1 |
+alias showfiles='defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder' |
|
2 |
+alias hidefiles='defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder' |
|
3 |
+ |
|
4 |
+# Recursively delete .DS_Store files |
|
5 |
+alias rm-dsstore="find . -name '*.DS_Store' -type f -delete" |
|
6 |
+ |
|
1 | 7 |
function savepath() { |
2 | 8 |
pwd > ~/.current_path~ |
3 | 9 |
} |
... | ... |
@@ -10,7 +10,6 @@ _phing_does_target_list_need_generating () { |
10 | 10 |
_phing () { |
11 | 11 |
if [ -f build.xml ]; then |
12 | 12 |
if _phing_does_target_list_need_generating; then |
13 |
- echo "\nGenerating .phing_targets..." > /dev/stderr |
|
14 | 13 |
phing -l |grep -v ":" |grep -v "^$"|grep -v "\-" > .phing_targets |
15 | 14 |
fi |
16 | 15 |
compadd `cat .phing_targets` |
17 | 16 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,10 @@ |
0 |
+# Thanks to Christopher Sexton |
|
1 |
+# https://gist.github.com/965032 |
|
2 |
+function kapow { |
|
3 |
+ touch ~/.pow/$1/tmp/restart.txt |
|
4 |
+ if [ $? -eq 0 ]; then |
|
5 |
+ echo "$fg[yellow]Pow restarting $1...$reset_color" |
|
6 |
+ fi |
|
7 |
+} |
|
8 |
+ |
|
9 |
+compctl -W ~/.pow -/ kapow |
... | ... |
@@ -1,4 +1,6 @@ |
1 |
+# TODO: Make this compatible with rvm. |
|
2 |
+# Run sudo gem on the system ruby, not the active ruby. |
|
1 | 3 |
alias sgem='sudo gem' |
2 | 4 |
|
3 | 5 |
# Find ruby file |
4 |
-alias rfind='find . -name *.rb | xargs grep -n' |
|
5 | 6 |
\ No newline at end of file |
7 |
+alias rfind='find . -name *.rb | xargs grep -n' |
6 | 8 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,147 @@ |
0 |
+#compdef rvm |
|
1 |
+ |
|
2 |
+local curcontext="$curcontext" state line cmds ret=1 |
|
3 |
+ |
|
4 |
+_arguments -C \ |
|
5 |
+ '(- 1 *)'{-v,--version}'[display version information]' \ |
|
6 |
+ '(-l|--level)'{-l,--level}'+[patch level to use with rvm use / install]:number' \ |
|
7 |
+ '(--prefix)--prefix[path for all rvm files (~/.rvm/), with trailing slash!]:path:_files' \ |
|
8 |
+ '(--bin)--bin[path for binaries to be placed (~/.rvm/bin/)]:path:_files' \ |
|
9 |
+ '(--source)--source[src directory to use (~/.rvm/src/)]:path:_files' \ |
|
10 |
+ '(--archives)--archives[directory for downladed files (~/.rvm/archives/)]:path:_files' \ |
|
11 |
+ '-S[Specify a script file to attempt to load and run (rubydo)]:file:_files' \ |
|
12 |
+ '-e[Execute code from the command line]:code' \ |
|
13 |
+ '(-G)-G[root gem path to use]:path:_files' \ |
|
14 |
+ '(--gems)--gems[Used to set the gems_flag, use with remove to remove gems]' \ |
|
15 |
+ '(--archive)--archive[Used to set the archive_flag, use with remove to remove archive]' \ |
|
16 |
+ '(--patch)--patch[With MRI Rubies you may specify one or more full paths to patches]' \ |
|
17 |
+ '(-C|--configure)'{-C,--configure}'=[custom configure options]' \ |
|
18 |
+ '(--nice)--nice[process niceness (for slow computers, default 0)]:number' \ |
|
19 |
+ '(--ree)--ree-options[Options passed directly to ree ./installer on the command line]:options' \ |
|
20 |
+ '(--head)--head[with update, updates rvm to git head version]' \ |
|
21 |
+ '(--rubygems)--rubygems[with update, updates rubygems for selected ruby]' \ |
|
22 |
+ '(--default)--default[with ruby select, sets a default ruby for new shells]' \ |
|
23 |
+ '(--debug)--debug[Toggle debug mode on for very verbose output]' \ |
|
24 |
+ '(--trace)--trace[Toggle trace mode on to see EVERYTHING rvm is doing]' \ |
|
25 |
+ '(--force)--force[Force install, removes old install & source before install]' \ |
|
26 |
+ '(--summary)--summary[Used with rubydo to print out a summary of the commands run]' \ |
|
27 |
+ '(--latest)--latest[with gemset --dump skips version strings for latest gem]' \ |
|
28 |
+ '(--gems)--gems[with uninstall/remove removes gems with the interpreter]' \ |
|
29 |
+ '(--docs)--docs[with install, attempt to generate ri after installation]' \ |
|
30 |
+ '(--reconfigure)--reconfigure[Force ./configure on install even if Makefile already exists]' \ |
|
31 |
+ '1: :->cmds' \ |
|
32 |
+ '*: :->args' && ret=0 |
|
33 |
+ |
|
34 |
+case $state in |
|
35 |
+ cmds) |
|
36 |
+ cmds=( |
|
37 |
+ "version:show the rvm version installed in rvm_path" |
|
38 |
+ "use:setup current shell to use a specific ruby version" |
|
39 |
+ "reload:reload rvm source itself (useful after changing rvm source)" |
|
40 |
+ "implode:(seppuku) removes the rvm installation completely. This means everything in $rvm_path (~/.rvm)." |
|
41 |
+ "update:upgrades rvm to the latest version." |
|
42 |
+ "reset:remove current and stored default & system settings." |
|
43 |
+ "info :show the *current* environment information for current ruby" |
|
44 |
+ "current:print the *current* ruby version and the name of any gemset being used." |
|
45 |
+ "debug:show info plus additional information for common issues" |
|
46 |
+ "install:install one or many ruby versions" |
|
47 |
+ "uninstall:uninstall one or many ruby versions, leaves their sources" |
|
48 |
+ "remove:uninstall one or many ruby versions and remove their sources" |
|
49 |
+ "migrate:Lets you migrate all gemsets from one ruby to another." |
|
50 |
+ "upgrade:Lets you upgrade from one version of a ruby to another, including migrating your gemsets semi-automatically." |
|
51 |
+ "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." |
|
52 |
+ "cleanup:Lets you remove stale source folders / archives and other miscellaneous data associated with rvm." |
|
53 |
+ "repair:Lets you repair parts of your environment e.g. wrappers, env files and and similar files (e.g. general maintenance)." |
|
54 |
+ "snapshot:Lets your backup / restore an rvm installation in a lightweight manner." |
|
55 |
+ "disk-usage:Tells you how much disk space rvm install is using." |
|
56 |
+ "tools:Provides general information about the ruby environment, primarily useful when scripting rvm." |
|
57 |
+ "docs:Tools to make installing ri and rdoc documentation easier." |
|
58 |
+ "rvmrc:Tools related to managing rvmrc trust and loading." |
|
59 |
+ "exec:runs an arbitrary command as a set operation." |
|
60 |
+ "ruby:runs a named ruby file against specified and/or all rubies" |
|
61 |
+ "gem:runs a gem command using selected ruby's 'gem'" |
|
62 |
+ "rake:runs a rake task against specified and/or all rubies" |
|
63 |
+ "tests:runs 'rake test' across selected ruby versions" |
|
64 |
+ "specs:runs 'rake spec' across selected ruby versions" |
|
65 |
+ "monitor:Monitor cwd for testing, run rake {spec,test} on changes." |
|
66 |
+ "gemset:gemsets: http://rvm.beginrescueend.com/gemsets/" |
|
67 |
+ "rubygems:Switches the installed version of rubygems for the current ruby." |
|
68 |
+ "gemdir:display the path to the current gem directory (GEM_HOME)." |
|
69 |
+ "srcdir:display the path to rvm source directory (may be yanked)" |
|
70 |
+ "fetch:Performs an archive / src fetch only of the selected ruby." |
|
71 |
+ "list:show currently installed rubies, interactive output." |
|
72 |
+ "package:Install a dependency package {readline,iconv,zlib,openssl}" |
|
73 |
+ "notes:Display notes, with operating system specifics." |
|
74 |
+ "export:Temporarily set an environment variable in the current shell." |
|
75 |
+ "unexport:Undo changes made to the environment by 'rvm export'." |
|
76 |
+ ) |
|
77 |
+ _describe -t commands 'rvm command' cmds && ret=0 |
|
78 |
+ ;; |
|
79 |
+ args) |
|
80 |
+ case $line[1] in |
|
81 |
+ (use|uninstall|remove|list) |
|
82 |
+ _values -S , 'rubies' $(rvm list strings | sed -e 's/ruby-\([^) ]*\)-\([^) ]*\)/ruby-\1-\2 \1-\2 \1/g') default system && ret=0 |
|
83 |
+ ;; |
|
84 |
+ (install|fetch) |
|
85 |
+ _values -S , 'rubies' $(rvm list known_strings) && ret=0 |
|
86 |
+ ;; |
|
87 |
+ gemset) |
|
88 |
+ if (( CURRENT == 3 )); then |
|
89 |
+ _values 'gemset_commands' \ |
|
90 |
+ 'import' \ |
|
91 |
+ 'export' \ |
|
92 |
+ 'create' \ |
|
93 |
+ 'copy' \ |
|
94 |
+ 'rename' \ |
|
95 |
+ 'empty' \ |
|
96 |
+ 'delete' \ |
|
97 |
+ 'name' \ |
|
98 |
+ 'dir' \ |
|
99 |
+ 'list' \ |
|
100 |
+ 'list_all' \ |
|
101 |
+ 'gemdir' \ |
|
102 |
+ 'install' \ |
|
103 |
+ 'pristine' \ |
|
104 |
+ 'clear' \ |
|
105 |
+ 'use' \ |
|
106 |
+ 'update' \ |
|
107 |
+ 'unpack' \ |
|
108 |
+ 'globalcache' |
|
109 |
+ else |
|
110 |
+ _values -S , 'gemsets' $(rvm gemset list | grep -v gemset 2>/dev/null) |
|
111 |
+ fi |
|
112 |
+ ret=0 |
|
113 |
+ ;; |
|
114 |
+ package) |
|
115 |
+ if (( CURRENT == 3 )); then |
|
116 |
+ _values 'package_commands' \ |
|
117 |
+ 'install' \ |
|
118 |
+ 'uninstall' |
|
119 |
+ else |
|
120 |
+ _values 'packages' \ |
|
121 |
+ 'readline' \ |
|
122 |
+ 'iconv' \ |
|
123 |
+ 'curl' \ |
|
124 |
+ 'openssl' \ |
|
125 |
+ 'zlib' \ |
|
126 |
+ 'autoconf' \ |
|
127 |
+ 'ncurses' \ |
|
128 |
+ 'pkgconfig' \ |
|
129 |
+ 'gettext' \ |
|
130 |
+ 'glib' \ |
|
131 |
+ 'mono' \ |
|
132 |
+ 'llvm' \ |
|
133 |
+ 'libxml2' \ |
|
134 |
+ 'libxslt' \ |
|
135 |
+ 'libyaml' |
|
136 |
+ fi |
|
137 |
+ ret=0 |
|
138 |
+ ;; |
|
139 |
+ *) |
|
140 |
+ (( ret )) && _message 'no more arguments' |
|
141 |
+ ;; |
|
142 |
+ esac |
|
143 |
+ ;; |
|
144 |
+esac |
|
145 |
+ |
|
146 |
+return ret |
0 | 147 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,44 @@ |
0 |
+alias rubies='rvm list rubies' |
|
1 |
+alias gemsets='rvm gemset list' |
|
2 |
+ |
|
3 |
+local ruby18='ruby-1.8.7-p334' |
|
4 |
+local ruby19='ruby-1.9.2-p180' |
|
5 |
+ |
|
6 |
+function rb18 { |
|
7 |
+ if [ -z "$1" ]; then |
|
8 |
+ rvm use "$ruby18" |
|
9 |
+ else |
|
10 |
+ rvm use "$ruby18@$1" |
|
11 |
+ fi |
|
12 |
+} |
|
13 |
+ |
|
14 |
+_rb18() {compadd `ls -1 $rvm_path/gems | grep "^$ruby18@" | sed -e "s/^$ruby18@//" | awk '{print $1}'`} |
|
15 |
+compdef _rb18 rb18 |
|
16 |
+ |
|
17 |
+function rb19 { |
|
18 |
+ if [ -z "$1" ]; then |
|
19 |
+ rvm use "$ruby19" |
|
20 |
+ else |
|
21 |
+ rvm use "$ruby19@$1" |
|
22 |
+ fi |
|
23 |
+} |
|
24 |
+ |
|
25 |
+_rb19() {compadd `ls -1 $rvm_path/gems | grep "^$ruby19@" | sed -e "s/^$ruby19@//" | awk '{print $1}'`} |
|
26 |
+compdef _rb19 rb19 |
|
27 |
+ |
|
28 |
+function rvm-update { |
|
29 |
+ rvm get head |
|
30 |
+ rvm reload # TODO: Reload rvm completion? |
|
31 |
+} |
|
32 |
+ |
|
33 |
+# TODO: Make this usable w/o rvm. |
|
34 |
+function gems { |
|
35 |
+ local current_ruby=`rvm-prompt i v p` |
|
36 |
+ local current_gemset=`rvm-prompt g` |
|
37 |
+ |
|
38 |
+ gem list $@ | sed \ |
|
39 |
+ -Ee "s/\([0-9\.]+( .+)?\)/$fg[blue]&$reset_color/g" \ |
|
40 |
+ -Ee "s|$(echo $rvm_path)|$fg[magenta]\$rvm_path$reset_color|g" \ |
|
41 |
+ -Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \ |
|
42 |
+ -Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g" |
|
43 |
+} |
... | ... |
@@ -13,7 +13,7 @@ function in_svn() { |
13 | 13 |
} |
14 | 14 |
|
15 | 15 |
function svn_get_repo_name { |
16 |
- if [ is_svn ]; then |
|
16 |
+ if [ in_svn ]; then |
|
17 | 17 |
svn info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT |
18 | 18 |
|
19 | 19 |
svn info | sed -n "s/URL:\ .*$SVN_ROOT\///p" | sed "s/\/.*$//" |
... | ... |
@@ -21,13 +21,13 @@ function svn_get_repo_name { |
21 | 21 |
} |
22 | 22 |
|
23 | 23 |
function svn_get_rev_nr { |
24 |
- if [ is_svn ]; then |
|
24 |
+ if [ in_svn ]; then |
|
25 | 25 |
svn info 2> /dev/null | sed -n s/Revision:\ //p |
26 | 26 |
fi |
27 | 27 |
} |
28 | 28 |
|
29 | 29 |
function svn_dirty_choose { |
30 |
- if [ is_svn ]; then |
|
30 |
+ if [ in_svn ]; then |
|
31 | 31 |
s=$(svn status 2>/dev/null) |
32 | 32 |
if [ $s ]; then |
33 | 33 |
echo $1 |
... | ... |
@@ -39,4 +39,4 @@ function svn_dirty_choose { |
39 | 39 |
|
40 | 40 |
function svn_dirty { |
41 | 41 |
svn_dirty_choose $ZSH_THEME_SVN_PROMPT_DIRTY $ZSH_THEME_SVN_PROMPT_CLEAN |
42 |
-} |
|
43 | 42 |
\ No newline at end of file |
43 |
+} |
... | ... |
@@ -1,11 +1,9 @@ |
1 |
+alias et='mate .' |
|
2 |
+alias ett='mate app config lib db public spec test Rakefile Capfile Todo' |
|
3 |
+alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo' |
|
4 |
+alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo' |
|
1 | 5 |
|
2 |
-# TextMate |
|
3 |
-alias et='mate . &' |
|
4 |
-alias ett='mate app config lib db public spec test Rakefile Capfile Todo &' |
|
5 |
-alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo &' |
|
6 |
-alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo &' |
|
7 |
- |
|
8 |
-# Editor Ruby file in TextMate |
|
6 |
+# Edit Ruby app in TextMate |
|
9 | 7 |
alias mr='mate CHANGELOG app config db lib public script spec test' |
10 | 8 |
|
11 | 9 |
function tm() { |
0 | 4 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,22 @@ |
0 |
+ |
|
1 |
+local user='%{$fg[magenta]%}%n@%{$fg[magenta]%}%m%{$reset_color%}' |
|
2 |
+local pwd='%{$fg[blue]%}%~%{$reset_color%}' |
|
3 |
+local rvm='%{$fg[green]%}‹$(rvm-prompt i v g)›%{$reset_color%}' |
|
4 |
+local return_code='%(?..%{$fg[red]%}%? ↵%{$reset_color%})' |
|
5 |
+local git_branch='$(git_prompt_status)%{$reset_color%}$(git_prompt_info)%{$reset_color%}' |
|
6 |
+ |
|
7 |
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}" |
|
8 |
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" |
|
9 |
+ZSH_THEME_GIT_PROMPT_DIRTY="" |
|
10 |
+ZSH_THEME_GIT_PROMPT_CLEAN="" |
|
11 |
+ |
|
12 |
+ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚" |
|
13 |
+ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹" |
|
14 |
+ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" |
|
15 |
+ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" |
|
16 |
+ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" |
|
17 |
+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" |
|
18 |
+ |
|
19 |
+PROMPT="${user} ${pwd}$ " |
|
20 |
+RPROMPT="${return_code} ${git_branch} ${rvm}" |
|
21 |
+ |
... | ... |
@@ -3,7 +3,18 @@ |
3 | 3 |
local user_color='green'; [ $UID -eq 0 ] && user_color='red' |
4 | 4 |
PROMPT='%n@%m %{$fg[$user_color]%}%~%{$reset_color%}%(!.#.>) ' |
5 | 5 |
PROMPT2='%{$fg[red]%}\ %{$reset_color%}' |
6 |
-RPS1='%(?..%{$fg[red]%}%? ↵%{$reset_color%})$(git_prompt_info)' |
|
7 | 6 |
|
8 |
-ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[cyan]%}" |
|
9 |
-ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" |
|
7 |
+local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}" |
|
8 |
+RPROMPT='${return_status}$(git_prompt_info)$(git_prompt_status)%{$reset_color%}' |
|
9 |
+ |
|
10 |
+ZSH_THEME_GIT_PROMPT_PREFIX=" " |
|
11 |
+ZSH_THEME_GIT_PROMPT_SUFFIX="" |
|
12 |
+ZSH_THEME_GIT_PROMPT_DIRTY="" |
|
13 |
+ZSH_THEME_GIT_PROMPT_CLEAN="" |
|
14 |
+ |
|
15 |
+ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[green]%}+" |
|
16 |
+ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[blue]%}!" |
|
17 |
+ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%}-" |
|
18 |
+ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[magenta]%}>" |
|
19 |
+ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[yellow]%}#" |
|
20 |
+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[cyan]%}?" |
10 | 21 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,6 @@ |
0 |
+PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' |
|
1 |
+ |
|
2 |
+ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[red]%}" |
|
3 |
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" |
|
4 |
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" |
|
5 |
+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" |
0 | 6 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,26 @@ |
0 |
+# ZSH THEME Preview: https://skitch.com/huyy/rk979/humza.zshtheme |
|
1 |
+ |
|
2 |
+let TotalBytes=0 |
|
3 |
+for Bytes in $(ls -l | grep "^-" | awk '{ print $5 }') |
|
4 |
+do |
|
5 |
+ let TotalBytes=$TotalBytes+$Bytes |
|
6 |
+done |
|
7 |
+ # should it say b, kb, Mb, or Gb |
|
8 |
+if [ $TotalBytes -lt 1024 ]; then |
|
9 |
+ TotalSize=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) |
|
10 |
+ suffix="b" |
|
11 |
+elif [ $TotalBytes -lt 1048576 ]; then |
|
12 |
+ TotalSize=$(echo -e "scale=3 \n$TotalBytes/1024 \nquit" | bc) |
|
13 |
+ suffix="kb" |
|
14 |
+elif [ $TotalBytes -lt 1073741824 ]; then |
|
15 |
+ TotalSize=$(echo -e "scale=3 \n$TotalBytes/1048576 \nquit" | bc) |
|
16 |
+ suffix="Mb" |
|
17 |
+else |
|
18 |
+ TotalSize=$(echo -e "scale=3 \n$TotalBytes/1073741824 \nquit" | bc) |
|
19 |
+ suffix="Gb" |
|
20 |
+fi |
|
21 |
+ |
|
22 |
+PROMPT='%{$reset_color%}%n %{$fg[green]%}{%{$reset_color%}%~%{$fg[green]%}}%{$reset_color%}$(git_prompt_info) greetings, earthling %{$fg[green]%}[%{$reset_color%}%{$TotalSize%}%{$suffix%}%{$fg[green]%}]%{$fg[red]%}$%{$reset_color%} ☞ ' |
|
23 |
+ |
|
24 |
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}±(" |
|
25 |
+ZSH_THEME_GIT_PROMPT_SUFFIX=");%{$reset_color%}" |
0 | 26 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,8 @@ |
0 |
+# Yay! High voltage and arrows! |
|
1 |
+ |
|
2 |
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" |
|
3 |
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " |
|
4 |
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}" |
|
5 |
+ZSH_THEME_GIT_PROMPT_CLEAN="" |
|
6 |
+ |
|
7 |
+PROMPT='%{$fg[cyan]%}%1~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}$(git_prompt_info)%{$fg[cyan]%}⇒%{$reset_color%} ' |
0 | 8 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,15 @@ |
0 |
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[white]%}[" |
|
1 |
+ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" |
|
2 |
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}●%{$reset_color%}" |
|
3 |
+ZSH_THEME_GIT_PROMPT_CLEAN="" |
|
4 |
+ |
|
5 |
+#Customized git status, oh-my-zsh currently does not allow render dirty status before branch |
|
6 |
+git_custom_status() { |
|
7 |
+ local cb=$(current_branch) |
|
8 |
+ if [ -n "$cb" ]; then |
|
9 |
+ echo "- $ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" |
|
10 |
+ fi |
|
11 |
+} |
|
12 |
+ |
|
13 |
+ |
|
14 |
+PROMPT='%2~ $(git_custom_status) »%b ' |
|
0 | 15 |
\ No newline at end of file |
1 | 16 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,17 @@ |
0 |
+# Based on robbyrussell's theme, with host and rvm indicators. Example: |
|
1 |
+# @host ➜ currentdir rvm:(rubyversion@gemset) git:(branchname) |
|
2 |
+ |
|
3 |
+# Get the current ruby version in use with RVM: |
|
4 |
+if [ -e ~/.rvm/bin/rvm-prompt ]; then |
|
5 |
+ RUBY_PROMPT_="%{$fg_bold[blue]%}rvm:(%{$fg[green]%}\$(~/.rvm/bin/rvm-prompt s i v g)%{$fg_bold[blue]%})%{$reset_color%} " |
|
6 |
+fi |
|
7 |
+ |
|
8 |
+# Get the host name (first 4 chars) |
|
9 |
+HOST_PROMPT_="%{$fg_bold[red]%}@$HOST[0,4] ➜ %{$fg_bold[cyan]%}%c " |
|
10 |
+GIT_PROMPT="%{$fg_bold[blue]%}\$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}" |
|
11 |
+PROMPT="$HOST_PROMPT_$RUBY_PROMPT_$GIT_PROMPT" |
|
12 |
+ |
|
13 |
+ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" |
|
14 |
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" |
|
15 |
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" |
|
16 |
+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" |
0 | 17 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,11 @@ |
0 |
+if [ "$(whoami)" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi |
|
1 |
+ |
|
2 |
+local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" |
|
3 |
+ |
|
4 |
+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}%} ' |
|
5 |
+ |
|
6 |
+RPS1="${return_code}" |
|
7 |
+ |
|
8 |
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}‹" |
|
9 |
+ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" |
|
10 |
+ |
0 | 11 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,15 @@ |
0 |
+if [ "$(whoami)" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="magenta"; fi |
|
1 |
+ |
|
2 |
+local return_code="%(?..%{$fg_bold[red]%}:( %?%{$reset_color%})" |
|
3 |
+ |
|
4 |
+PROMPT=' |
|
5 |
+%{$fg_bold[cyan]%}%n%{$reset_color%}%{$fg[yellow]%}@%{$reset_color%}%{$fg_bold[blue]%}%m%{$reset_color%}:%{${fg_bold[green]}%}%~%{$reset_color%}$(git_prompt_info) |
|
6 |
+%{${fg[$CARETCOLOR]}%}%# %{${reset_color}%}' |
|
7 |
+ |
|
8 |
+RPS1='${return_code} %D - %*' |
|
9 |
+ |
|
10 |
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[magenta]%}^%{$reset_color%}%{$fg_bold[yellow]%}" |
|
11 |
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" |
|
12 |
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%} ±" |
|
13 |
+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ?" |
|
14 |
+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[red]%} ♥" |
0 | 6 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,100 @@ |
0 |
+# prompt style and colors based on Steve Losh's Prose theme: |
|
1 |
+# http://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme |
|
2 |
+# |
|
3 |
+# vcs_info modifications from Bart Trojanowski's zsh prompt: |
|
4 |
+# http://www.jukie.net/bart/blog/pimping-out-zsh-prompt |
|
5 |
+# |
|
6 |
+# git untracked files modification from Brian Carper: |
|
7 |
+# http://briancarper.net/blog/570/git-info-in-your-zsh-prompt |
|
8 |
+ |
|
9 |
+function virtualenv_info { |
|
10 |
+ [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' |
|
11 |
+} |
|
12 |
+PR_GIT_UPDATE=1 |
|
13 |
+ |
|
14 |
+setopt prompt_subst |
|
15 |
+autoload colors |
|
16 |
+colors |
|
17 |
+ |
|
18 |
+autoload -U add-zsh-hook |
|
19 |
+autoload -Uz vcs_info |
|
20 |
+ |
|
21 |
+#use extended color pallete if available |
|
22 |
+if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then |
|
23 |
+ turquoise="%F{81}" |
|
24 |
+ orange="%F{166}" |
|
25 |
+ purple="%F{135}" |
|
26 |
+ hotpink="%F{161}" |
|
27 |
+ limegreen="%F{118}" |
|
28 |
+else |
|
29 |
+ turquoise="$fg[cyan]" |
|
30 |
+ orange="$fg[yellow]" |
|
31 |
+ purple="$fg[magenta]" |
|
32 |
+ hotpink="$fg[red]" |
|
33 |
+ limegreen="$fg[green]" |
|
34 |
+fi |
|
35 |
+ |
|
36 |
+# enable VCS systems you use |
|
37 |
+zstyle ':vcs_info:*' enable git svn |
|
38 |
+ |
|
39 |
+# check-for-changes can be really slow. |
|
40 |
+# you should disable it, if you work with large repositories |
|
41 |
+zstyle ':vcs_info:*:prompt:*' check-for-changes true |
|
42 |
+ |
|
43 |
+# set formats |
|
44 |
+# %b - branchname |
|
45 |
+# %u - unstagedstr (see below) |
|
46 |
+# %c - stagedstr (see below) |
|
47 |
+# %a - action (e.g. rebase-i) |
|
48 |
+# %R - repository path |
|
49 |
+# %S - path in the repository |
|
50 |
+PR_RST="%{${reset_color}%}" |
|
51 |
+FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})" |
|
52 |
+FMT_ACTION="(%{$limegreen%}%a${PR_RST})" |
|
53 |
+FMT_UNSTAGED="%{$orange%}●" |
|
54 |
+FMT_STAGED="%{$limegreen%}●" |
|
55 |
+ |
|
56 |
+zstyle ':vcs_info:*:prompt:*' unstagedstr "${FMT_UNSTAGED}" |
|
57 |
+zstyle ':vcs_info:*:prompt:*' stagedstr "${FMT_STAGED}" |
|
58 |
+zstyle ':vcs_info:*:prompt:*' actionformats "${FMT_BRANCH}${FMT_ACTION}" |
|
59 |
+zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}" |
|
60 |
+zstyle ':vcs_info:*:prompt:*' nvcsformats "" |
|
61 |
+ |
|
62 |
+ |
|
63 |
+function steeef_preexec { |
|
64 |
+ case "$(history $HISTCMD)" in |
|
65 |
+ *git*) |
|
66 |
+ PR_GIT_UPDATE=1 |
|
67 |
+ ;; |
|
68 |
+ *svn*) |
|
69 |
+ PR_GIT_UPDATE=1 |
|
70 |
+ ;; |
|
71 |
+ esac |
|
72 |
+} |
|
73 |
+add-zsh-hook preexec steeef_preexec |
|
74 |
+ |
|
75 |
+function steeef_chpwd { |
|
76 |
+ PR_GIT_UPDATE=1 |
|
77 |
+} |
|
78 |
+add-zsh-hook chpwd steeef_chpwd |
|
79 |
+ |
|
80 |
+function steeef_precmd { |
|
81 |
+ if [[ -n "$PR_GIT_UPDATE" ]] ; then |
|
82 |
+ # check for untracked files or updated submodules, since vcs_info doesn't |
|
83 |
+ if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then |
|
84 |
+ PR_GIT_UPDATE=1 |
|
85 |
+ FMT_BRANCH="(%{$turquoise%}%b%u%c%{$hotpink%}●${PR_RST})" |
|
86 |
+ else |
|
87 |
+ FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})" |
|
88 |
+ fi |
|
89 |
+ zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}" |
|
90 |
+ |
|
91 |
+ vcs_info 'prompt' |
|
92 |
+ PR_GIT_UPDATE= |
|
93 |
+ fi |
|
94 |
+} |
|
95 |
+add-zsh-hook precmd steeef_precmd |
|
96 |
+ |
|
97 |
+PROMPT=$' |
|
98 |
+%{$purple%}%n%{$reset_color%} at %{$orange%}%m%{$reset_color%} in %{$limegreen%}%~%{$reset_color%} $vcs_info_msg_0_ |
|
99 |
+$(virtualenv_info)$ ' |
0 | 100 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,26 @@ |
0 |
+# Git-centric variation of the "fishy" theme. |
|
1 |
+# See screenshot at http://ompldr.org/vOHcwZg |
|
2 |
+ |
|
3 |
+ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%}+" |
|
4 |
+ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[magenta]%}!" |
|
5 |
+ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}-" |
|
6 |
+ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}>" |
|
7 |
+ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[cyan]%}#" |
|
8 |
+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[yellow]%}?" |
|
9 |
+ |
|
10 |
+ZSH_THEME_GIT_PROMPT_PREFIX="" |
|
11 |
+ZSH_THEME_GIT_PROMPT_SUFFIX=" " |
|
12 |
+ZSH_THEME_GIT_PROMPT_DIRTY="" |
|
13 |
+ZSH_THEME_GIT_PROMPT_CLEAN="" |
|
14 |
+ |
|
15 |
+local user_color='green' |
|
16 |
+test $UID -eq 0 && user_color='red' |
|
17 |
+ |
|
18 |
+PROMPT='%(?..%{$fg_bold[red]%}exit %? |
|
19 |
+%{$reset_color%})'\ |
|
20 |
+'%{$bold_color%}$(git_prompt_status)%{$reset_color%}'\ |
|
21 |
+'$(git_prompt_info)'\ |
|
22 |
+'%{$fg[$user_color]%}%~%{$reset_color%}'\ |
|
23 |
+'%(!.#.>) ' |
|
24 |
+ |
|
25 |
+PROMPT2='%{$fg[red]%}\ %{$reset_color%}' |
0 | 26 |
deleted file mode 100644 |
... | ... |
@@ -1,29 +0,0 @@ |
1 |
-function prompt_char { |
|
2 |
- git branch >/dev/null 2>/dev/null && echo '±' && return |
|
3 |
- hg root >/dev/null 2>/dev/null && echo '☿' && return |
|
4 |
- echo '○' |
|
5 |
-} |
|
6 |
- |
|
7 |
-function virtualenv_info { |
|
8 |
- [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' |
|
9 |
-} |
|
10 |
- |
|
11 |
-function hg_prompt_info { |
|
12 |
- hg prompt --angle-brackets "\ |
|
13 |
-< on %{$fg[magenta]%}<branch>%{$reset_color%}>\ |
|
14 |
-< at %{$fg[yellow]%}<tags|%{$reset_color%}, %{$fg[yellow]%}>%{$reset_color%}>\ |
|
15 |
-%{$fg[green]%}<status|modified|unknown><update>%{$reset_color%}< |
|
16 |
-patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null |
|
17 |
-} |
|
18 |
- |
|
19 |
-PROMPT=' |
|
20 |
-%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(hg_prompt_info)$(git_prompt_info) |
|
21 |
-$(virtualenv_info)$(prompt_char) ' |
|
22 |
- |
|
23 |
-ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" |
|
24 |
-ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" |
|
25 |
-ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!" |
|
26 |
-ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" |
|
27 |
-ZSH_THEME_GIT_PROMPT_CLEAN="" |
|
28 |
- |
|
29 |
-. ~/bin/dotfiles/zsh/aliases |
30 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,95 @@ |
0 |
+# Name: trapd00r zsh theme |
|
1 |
+# Author: Magnus Woldrich <m@japh.se> |
|
2 |
+# |
|
3 |
+# This theme needs a terminal supporting 256 colors as well as unicode. It also |
|
4 |
+# needs the script that splits up the current path and makes it fancy as located |
|
5 |
+# here: https://github.com/trapd00r/utils/blob/master/zsh_path |
|
6 |
+# |
|
7 |
+# By default it spans over two lines like so: |
|
8 |
+# |
|
9 |
+# scp1@shiva:pts/9-> /home » scp1 (0) |
|
10 |
+# > |
|
11 |
+# |
|
12 |
+# that's user@host:pts/-> splitted path (return status) |
|
13 |
+# |
|
14 |
+# If the current directory is a git repository, we span 3 lines; |
|
15 |
+# |
|
16 |
+# git❨ master ❩ DIRTY |
|
17 |
+# scp1@shiva:pts/4-> /home » scp1 » dev » utils (0) |
|
18 |
+# > |
|
19 |
+ |
|
20 |
+autoload -U add-zsh-hook |
|
21 |
+autoload -Uz vcs_info |
|
22 |
+ |
|
23 |
+local c0=$( printf "\e[m") |
|
24 |
+local c1=$( printf "\e[38;5;245m") |
|
25 |
+local c2=$( printf "\e[38;5;250m") |
|
26 |
+local c3=$( printf "\e[38;5;242m") |
|
27 |
+local c4=$( printf "\e[38;5;197m") |
|
28 |
+local c5=$( printf "\e[38;5;225m") |
|
29 |
+local c6=$( printf "\e[38;5;240m") |
|
30 |
+local c7=$( printf "\e[38;5;242m") |
|
31 |
+local c8=$( printf "\e[38;5;244m") |
|
32 |
+local c9=$( printf "\e[38;5;162m") |
|
33 |
+local c10=$(printf "\e[1m") |
|
34 |
+local c11=$(printf "\e[38;5;208m\e[1m") |
|
35 |
+local c12=$(printf "\e[38;5;142m\e[1m") |
|
36 |
+local c13=$(printf "\e[38;5;196m\e[1m") |
|
37 |
+ |
|
38 |
+ |
|
39 |
+# We dont want to use the extended colorset in the TTY / VC. |
|
40 |
+if [ "$TERM" = "linux" ]; then |
|
41 |
+ c1=$( printf "\e[34;1m") |
|
42 |
+ c2=$( printf "\e[35m") |
|
43 |
+ c3=$( printf "\e[31m") |
|
44 |
+ c4=$( printf "\e[31;1m") |
|
45 |
+ c5=$( printf "\e[32m") |
|
46 |
+ c6=$( printf "\e[32;1m") |
|
47 |
+ c7=$( printf "\e[33m") |
|
48 |
+ c8=$( printf "\e[33;1m") |
|
49 |
+ c9=$( printf "\e[34m") |
|
50 |
+ |
|
51 |
+ c11=$(printf "\e[35;1m") |
|
52 |
+ c12=$(printf "\e[36m") |
|
53 |
+ c13=$(printf "\e[31;1m") |
|
54 |
+fi |
|
55 |
+ |
|
56 |
+zstyle ':vcs_info:*' actionformats \ |
|
57 |
+ '%{$c8%}(%f%s)%{$c7%}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' |
|
58 |
+ |
|
59 |
+zstyle ':vcs_info:*' formats \ |
|
60 |
+ "%{$c8%}%s%%{$c7%}❨ %{$c9%}%{$c11%}%b%{$c7%} ❩%{$reset_color%}%f " |
|
61 |
+ |
|
62 |
+zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' |
|
63 |
+zstyle ':vcs_info:*' enable git |
|
64 |
+ |
|
65 |
+add-zsh-hook precmd prompt_jnrowe_precmd |
|
66 |
+ |
|
67 |
+prompt_jnrowe_precmd () { |
|
68 |
+ vcs_info |
|
69 |
+ if [ "${vcs_info_msg_0_}" = "" ]; then |
|
70 |
+ dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" |
|
71 |
+ PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%} |
|
72 |
+> ' |
|
73 |
+ |
|
74 |
+# modified, to be commited |
|
75 |
+ elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then |
|
76 |
+ dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" |
|
77 |
+ PROMPT='${vcs_info_msg_0_}%{$30%} %{$bg_bold[red]%}%{$fg_bold[cyan]%}C%{$fg_bold[black]%}OMMIT%{$reset_color%} |
|
78 |
+%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} |
|
79 |
+> ' |
|
80 |
+ |
|
81 |
+ elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then |
|
82 |
+ dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" |
|
83 |
+ PROMPT='${vcs_info_msg_0_}%{$bg_bold[red]%}%{$fg_bold[blue]%}D%{$fg_bold[black]%}IRTY%{$reset_color%} |
|
84 |
+%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} |
|
85 |
+%{$c13%}>%{$c0%} ' |
|
86 |
+ else |
|
87 |
+ dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" |
|
88 |
+ PROMPT='${vcs_info_msg_0_} |
|
89 |
+%{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%} |
|
90 |
+> ' |
|
91 |
+fi |
|
92 |
+} |
|
93 |
+ |
|
94 |
+# vim: set ft=zsh sw=2 et tw=0: |
... | ... |
@@ -1,36 +1,36 @@ |
1 | 1 |
if [ -d ~/.oh-my-zsh ] |
2 | 2 |
then |
3 |
- echo "You already have Oh My Zsh installed. You'll need to remove ~/.oh-my-zsh if you want to install" |
|
3 |
+ echo "\033[0;33mYou already have Oh My Zsh installed.\033[0m You'll need to remove ~/.oh-my-zsh if you want to install" |
|
4 | 4 |
exit |
5 | 5 |
fi |
6 | 6 |
|
7 |
-echo "Cloning Oh My Zsh..." |
|
7 |
+echo "\033[0;34mCloning Oh My Zsh...\033[0m" |
|
8 | 8 |
/usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh |
9 | 9 |
|
10 |
-echo "Looking for an existing zsh config..." |
|
10 |
+echo "\033[0;34mLooking for an existing zsh config...\033[0m" |
|
11 | 11 |
if [ -f ~/.zshrc ] || [ -h ~/.zshrc ] |
12 | 12 |
then |
13 |
- echo "Found ~/.zshrc. Backing up to ~/.zshrc.pre-oh-my-zsh"; |
|
13 |
+ echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32]Backing up to ~/.zshrc.pre-oh-my-zsh\033[0m"; |
|
14 | 14 |
cp ~/.zshrc ~/.zshrc.pre-oh-my-zsh; |
15 | 15 |
rm ~/.zshrc; |
16 | 16 |
fi |
17 | 17 |
|
18 |
-echo "Using the Oh My Zsh template file and adding it to ~/.zshrc" |
|
18 |
+echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m" |
|
19 | 19 |
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc |
20 | 20 |
|
21 |
-echo "Copying your current PATH and adding it to the end of ~/.zshrc for you." |
|
21 |
+echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" |
|
22 | 22 |
echo "export PATH=$PATH" >> ~/.zshrc |
23 | 23 |
|
24 |
-echo "Time to change your default shell to zsh!" |
|
24 |
+echo "\033[0;34mTime to change your default shell to zsh!\033[0m" |
|
25 | 25 |
chsh -s `which zsh` |
26 | 26 |
|
27 |
-echo ' __ __ ' |
|
28 |
-echo ' ____ / /_ ____ ___ __ __ ____ _____/ /_ ' |
|
29 |
-echo ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ ' |
|
30 |
-echo '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / ' |
|
31 |
-echo '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ ' |
|
32 |
-echo ' /____/' |
|
27 |
+echo "\033[0;32m"' __ __ '"\033[0m" |
|
28 |
+echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" |
|
29 |
+echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" |
|
30 |
+echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" |
|
31 |
+echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" |
|
32 |
+echo "\033[0;32m"' /____/ '"\033[0m" |
|
33 | 33 |
|
34 |
-echo "\n\n ....is now installed." |
|
34 |
+echo "\n\n \033[0;32m....is now installed.\033[0m" |
|
35 | 35 |
/usr/bin/env zsh |
36 | 36 |
source ~/.zshrc |
... | ... |
@@ -1,12 +1,12 @@ |
1 | 1 |
current_path=`pwd` |
2 |
-echo "Upgrading Oh My Zsh" |
|
2 |
+echo "\033[0;34mUpgrading Oh My Zsh\033[0m" |
|
3 | 3 |
( cd $ZSH && git pull origin master ) |
4 |
-echo ' __ __ ' |
|
5 |
-echo ' ____ / /_ ____ ___ __ __ ____ _____/ /_ ' |
|
6 |
-echo ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ ' |
|
7 |
-echo '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / ' |
|
8 |
-echo '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ ' |
|
9 |
-echo ' /____/' |
|
10 |
-echo "Hooray! Oh My Zsh has been updated and/or is at the current version. \nAny new updates will be reflected when you start your next terminal session." |
|
11 |
-echo "To keep up on the latest, be sure to follow Oh My Zsh on twitter: http://twitter.com/ohmyzsh" |
|
12 |
-cd $current_path |
|
13 | 4 |
\ No newline at end of file |
5 |
+echo "\033[0;32m"' __ __ '"\033[0m" |
|
6 |
+echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" |
|
7 |
+echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" |
|
8 |
+echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" |
|
9 |
+echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" |
|
10 |
+echo "\033[0;32m"' /____/ '"\033[0m" |
|
11 |
+echo "\033[0;34mHooray! Oh My Zsh has been updated and/or is at the current version.\033[0m" |
|
12 |
+echo "\033[0;34mTo keep up on the latest, be sure to follow Oh My Zsh on twitter: \033[1mhttp://twitter.com/ohmyzsh\033[0m" |
|
13 |
+cd $current_path |