Create gnzh theme and vundle plugin
Robby Russell authored on 10/10/2011 at 12:30:551 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,23 @@ |
0 |
+function vundle-init () { |
|
1 |
+ if [ ! -d ~/.vim/bundle/vundle/ ] |
|
2 |
+ then |
|
3 |
+ mkdir -p ~/.vim/bundle/vundle/ |
|
4 |
+ fi |
|
5 |
+ |
|
6 |
+ if [ ! -d ~/.vim/bundle/vundle/.git/ ] |
|
7 |
+ then |
|
8 |
+ git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle |
|
9 |
+ echo "\n\tRead about vim configuration for vundle at https://github.com/gmarik/vundle\n" |
|
10 |
+ fi |
|
11 |
+} |
|
12 |
+ |
|
13 |
+function vundle () { |
|
14 |
+ vundle-init |
|
15 |
+ vim -c "execute \"BundleInstall\" | q | q" |
|
16 |
+} |
|
17 |
+ |
|
18 |
+ |
|
19 |
+function vundle-update () { |
|
20 |
+ vundle-init |
|
21 |
+ vim -c "execute \"BundleInstall!\" | q | q" |
|
22 |
+} |
0 | 23 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,54 @@ |
0 |
+# ZSH Theme - Preview: http://dl.dropbox.com/u/4109351/pics/gnzh-zsh-theme.png |
|
1 |
+# Based on bira theme |
|
2 |
+ |
|
3 |
+# load some modules |
|
4 |
+autoload -U colors zsh/terminfo # Used in the colour alias below |
|
5 |
+colors |
|
6 |
+setopt prompt_subst |
|
7 |
+ |
|
8 |
+# make some aliases for the colours: (coud use normal escap.seq's too) |
|
9 |
+for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do |
|
10 |
+ eval PR_$color='%{$fg[${(L)color}]%}' |
|
11 |
+done |
|
12 |
+eval PR_NO_COLOR="%{$terminfo[sgr0]%}" |
|
13 |
+eval PR_BOLD="%{$terminfo[bold]%}" |
|
14 |
+ |
|
15 |
+# Check the UID |
|
16 |
+if [[ $UID -ge 1000 ]]; then # normal user |
|
17 |
+ eval PR_USER='${PR_GREEN}%n${PR_NO_COLOR}' |
|
18 |
+ eval PR_USER_OP='${PR_GREEN}%#${PR_NO_COLOR}' |
|
19 |
+ local PR_PROMPT='$PR_NO_COLOR➤ $PR_NO_COLOR' |
|
20 |
+elif [[ $UID -eq 0 ]]; then # root |
|
21 |
+ eval PR_USER='${PR_RED}%n${PR_NO_COLOR}' |
|
22 |
+ eval PR_USER_OP='${PR_RED}%#${PR_NO_COLOR}' |
|
23 |
+ local PR_PROMPT='$PR_RED➤ $PR_NO_COLOR' |
|
24 |
+fi |
|
25 |
+ |
|
26 |
+# Check if we are on SSH or not |
|
27 |
+if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then |
|
28 |
+ eval PR_HOST='${PR_YELLOW}%M${PR_NO_COLOR}' #SSH |
|
29 |
+else |
|
30 |
+ eval PR_HOST='${PR_GREEN}%M${PR_NO_COLOR}' # no SSH |
|
31 |
+fi |
|
32 |
+ |
|
33 |
+local return_code="%(?..%{$PR_RED%}%? ↵%{$PR_NO_COLOR%})" |
|
34 |
+ |
|
35 |
+local user_host='${PR_USER}${PR_CYAN}@${PR_HOST}' |
|
36 |
+local current_dir='%{$PR_BOLD$PR_BLUE%}%~%{$PR_NO_COLOR%}' |
|
37 |
+local rvm_ruby='' |
|
38 |
+if which rvm-prompt &> /dev/null; then |
|
39 |
+ rvm_ruby='%{$PR_RED%}‹$(rvm-prompt i v g s)›%{$PR_NO_COLOR%}' |
|
40 |
+else |
|
41 |
+ if which rbenv &> /dev/null; then |
|
42 |
+ rvm_ruby='%{$PR_RED%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$PR_NO_COLOR%}' |
|
43 |
+ fi |
|
44 |
+fi |
|
45 |
+local git_branch='$(git_prompt_info)%{$PR_NO_COLOR%}' |
|
46 |
+ |
|
47 |
+#PROMPT="${user_host} ${current_dir} ${rvm_ruby} ${git_branch}$PR_PROMPT " |
|
48 |
+PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch} |
|
49 |
+╰─$PR_PROMPT " |
|
50 |
+RPS1="${return_code}" |
|
51 |
+ |
|
52 |
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$PR_YELLOW%}‹" |
|
53 |
+ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$PR_NO_COLOR%}" |