From ffad1a76251b48fabe300232536ab4baab4524bd Mon Sep 17 00:00:00 2001 From: Robin Wenglewski Date: Tue, 13 Sep 2011 10:58:35 +0200 Subject: [PATCH] configuration and cool theme --- .gitignore | 1 + config.zsh | 1 + functions.zsh | 10 ---------- themes/rweng.zsh-theme | 15 +++++++++++++++ zshrc | 13 ++++++------- 5 files changed, 23 insertions(+), 17 deletions(-) delete mode 100644 functions.zsh create mode 100644 themes/rweng.zsh-theme diff --git a/.gitignore b/.gitignore index 2e8db7341..278852dbd 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ custom/* !custom/example.zsh cache *.swp +.DS_Store \ No newline at end of file diff --git a/config.zsh b/config.zsh index b4092cb13..0c2bbb258 100644 --- a/config.zsh +++ b/config.zsh @@ -72,6 +72,7 @@ unsetopt EXTENDED_HISTORY # add timestamps to history #bindkey '' forward-word # ctrl-< and crtrl-> still works +export DISABLE_AUTO_UPDATE=true # rvm, should be at the end of this config file [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session. diff --git a/functions.zsh b/functions.zsh deleted file mode 100644 index 387c516c8..000000000 --- a/functions.zsh +++ /dev/null @@ -1,10 +0,0 @@ -function title { - if [ "$TAB_TITLE" != "" ];then 1=$TAB_TITLE;fi - [ "$DISABLE_AUTO_TITLE" != "true" ] || return - 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 - 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 -} diff --git a/themes/rweng.zsh-theme b/themes/rweng.zsh-theme new file mode 100644 index 000000000..cca6f33a3 --- /dev/null +++ b/themes/rweng.zsh-theme @@ -0,0 +1,15 @@ +ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} ✘" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ✔" + +function prompt_char { + if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo "%{$fg[red]%}⚡"; fi +} + +PROMPT='%(?, ,%{$fg[red]%}FAIL: $?%{$reset_color%} +) +%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) +%_$(prompt_char) ' + +RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' diff --git a/zshrc b/zshrc index b02a21dd6..26b57876e 100755 --- a/zshrc +++ b/zshrc @@ -3,19 +3,19 @@ [[ -f /etc/profile ]] && . /etc/profile # Path to your oh-my-zsh configuration. -ZSH=$HOME/.oh-my-zsh +ZSH=$HOME/.zsh # Set name of the theme to load. # Look in ~/.oh-my-zsh/themes/ # Optionally, if you set this to "random", it'll load a random theme each # time that oh-my-zsh is loaded. -ZSH_THEME="robbyrussell" +ZSH_THEME="rweng" # Set to this to use case-sensitive completion # CASE_SENSITIVE="true" # Comment this out to disable weekly auto-update checks -# DISABLE_AUTO_UPDATE="true" +DISABLE_AUTO_UPDATE="true" # Uncomment following line if you want to disable colors in ls # DISABLE_LS_COLORS="true" @@ -37,10 +37,9 @@ alias h="dirs -v" unalias d RWZSH=$HOME/.zsh -. $RWZSH/config.zsh -. $RWZSH/aliases.zsh -. $RWZSH/completion.zsh -. $RWZSH/functions.zsh +. $ZSH/config.zsh +. $ZSH/aliases.zsh +. $ZSH/completion.zsh # use .localrc for settings specific to one system [[ -f ~/.localrc ]] && . ~/.localrc