diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh index 9f053383a..ce42514e3 100644 --- a/plugins/battery/battery.plugin.zsh +++ b/plugins/battery/battery.plugin.zsh @@ -46,7 +46,7 @@ if [[ $(uname) == "Darwin" ]] ; then fi echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}" else - echo "∞" + echo "⚡" fi } diff --git a/plugins/cp/cp.plugin.zsh b/plugins/cp/cp.plugin.zsh index 7355a9990..231759efc 100644 --- a/plugins/cp/cp.plugin.zsh +++ b/plugins/cp/cp.plugin.zsh @@ -11,4 +11,4 @@ # -e /dev/null - only work on local files # -- - everything after this is an argument, even if it looks like an option -alias cpv="rsync -poghb --backup-dir=/tmp/rsync -e /dev/null --progress --" +alias cpv="rsync -phb --backup-dir=/tmp/rsync -e /dev/null --progress --" diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 7b3cec27d..d7158f67d 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -101,6 +101,13 @@ compdef git-svn-dcommit-push=git alias gsr='git svn rebase' alias gsd='git svn dcommit' + +function in_git { + if $(git status > /dev/null 2>&1); then + echo 1 + fi +} + # # Will return the current branch name # Usage example: git pull origin $(current_branch) diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh index d2db89d04..2353918f6 100644 --- a/plugins/mercurial/mercurial.plugin.zsh +++ b/plugins/mercurial/mercurial.plugin.zsh @@ -33,7 +33,7 @@ function hg_prompt_info { if [ $(in_hg) ]; then _DISPLAY=$(hg_get_branch_name) echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_HG_PROMPT_PREFIX\ -$ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_HG_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(hg_dirty)$ZSH_PROMPT_BASE_COLOR" +$ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR $fg_bold[red]%}$(hgic)%{$reset_color%}%{$fg_bold[blue]%}$(hgoc)%{$reset_color%}$ZSH_THEME_HG_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(hg_dirty)$ZSH_PROMPT_BASE_COLOR" unset _DISPLAY fi } diff --git a/themes/netpunk.zsh-theme b/themes/netpunk.zsh-theme new file mode 100644 index 000000000..ec1a1f64c --- /dev/null +++ b/themes/netpunk.zsh-theme @@ -0,0 +1,40 @@ +## +# Developed by NETPUNK#, software services +# http://www.netpunk.net (not up ATM) +# +# Depends on rbenv/rvm, git, mercurial and battery plugins +# +# License: MIT +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +## + + +function prompt_char { + git branch >/dev/null 2>/dev/null && echo 'GIT ☢ ↪' && return + hg root >/dev/null 2>/dev/null && echo 'HG ☢ ↪' && return + echo ' ☢ ↪' +} + +if which rvm-prompt &> /dev/null; then + PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%} %~ %{$reset_color%}$(hg_prompt_info)$(git_prompt_info)%{$reset_color%} + $(prompt_char) ' + RPROMPT='%{$fg[red]%}RB $(~/.rvm/bin/rvm-prompt)%{$reset_color%} %{$fg[magenta]%}$(date "+%Y-%m-%d")%{$reset_color%} %{$fg[green]%} BAT: %{$reset_color%} $(battery_charge)' +elif which rbenv &> /dev/null; then + PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%} %~ %{$reset_color%}$(hg_prompt_info)$(git_prompt_info)%{$reset_color%} + $(prompt_char) ' + RPROMPT='%{$fg[red]%}RB $(rbenv version | sed -e "s/ (set.*$//")%{$reset_color%} %{$fg[magenta]%}$(date "+%Y-%m-%d")%{$reset_color%} $(battery_pct_prompt)' + +fi + +ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%} " +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[white]%}%{$bg[red]%} ✖ " +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[white]%}%{$bg[magenta]%} ◘ " +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ✔ "