Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

mercurial prompt info #976

Closed
wants to merge 8 commits into from

3 participants

@zalew

works similar to git_prompt_info.
returns rev_no:rev_id@branch(tag)

@jamerlan

We really need mercurial prompt in oh-my-zsh

@zalew

there are 99 open pull requests, does someone even look in here?

@robbyrussell

@zalew apologies, can you send over pull-requests for each piece individually?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 28, 2012
  1. @zalew
Commits on Mar 3, 2012
  1. @zalew

    personal theme

    zalew authored
  2. @zalew

    install my personal fork

    zalew authored
Commits on Apr 11, 2012
  1. @zalew
  2. @zalew

    bugfix > 0

    zalew authored
  3. @zalew

    bugfix: now it works properly

    zalew authored
Commits on Aug 9, 2012
  1. @zalew
  2. @zalew

    merged with upstream

    zalew authored
This page is out of date. Refresh to see the latest.
View
32 lib/android.zsh
@@ -0,0 +1,32 @@
+function android_sdk_version() {
+ sdk=$(xmlstarlet sel -t -v "/manifest/uses-sdk/@android:minSdkVersion" AndroidManifest.xml 2> /dev/null) || return
+ versions[1]='1.0 Base'
+ versions[2]='1.1 Base 1.1'
+ versions[3]='1.5 Cupcake'
+ versions[4]='1.6 Cupcake'
+ versions[5]='2.0 Eclair'
+ versions[6]='2.0.1 Eclair 0.1'
+ versions[7]='2.1 Eclair MR1'
+ versions[8]='2.2 Froyo'
+ versions[9]='2.3.0-2 Gingerbread'
+ versions[10]='2.3.3-4 Gingerbread MR1'
+ versions[11]='3.0 Honeycomb'
+ versions[12]='3.1 Honeycomb MR1'
+ versions[13]='3.2 Honeycomb MR2'
+ versions[14]='4.0.0-2 Ice Cream Sandwich'
+ versions[15]='4.0.0-2 Ice Cream Sandwich MR1'
+ version="$versions[$sdk]"
+ echo "$version"
+}
+
+function android_package_name() {
+ package=$(xmlstarlet sel -t -v "/manifest/@package" AndroidManifest.xml 2> /dev/null) || return
+ echo "$package"
+}
+
+function android_prompt_info() {
+ if [ -n "$(android_sdk_version)" ]; then
+ echo "${ZSH_THEME_ANDROID_PROMPT_PREFIX}$(android_package_name) $(android_sdk_version)${ZSH_THEME_ANDROID_PROMPT_SUFFIX}"
+ fi
+
+}
View
7 lib/mercurial.zsh
@@ -0,0 +1,7 @@
+function hg_prompt_info() {
+ branch=$(hg id -b 2> /dev/null) || return
+ tag=$(hg id -t 2> /dev/null) || return
+ rev_number=$(hg id -n 2> /dev/null) || return
+ rev_id=$(hg id -i 2> /dev/null) || return
+ echo "${ZSH_THEME_HG_PROMPT_PREFIX}${rev_number/\+/}:${rev_id/\+/}@${branch}(${tag})${ZSH_THEME_HG_PROMPT_SUFFIX}"
+}
View
1  plugins/debian/debian.plugin.zsh
@@ -46,6 +46,7 @@ if [[ $use_sudo -eq 1 ]]; then
alias ad='sudo $apt_pref update'
alias adg='sudo $apt_pref update && sudo $apt_pref upgrade'
alias adu='sudo $apt_pref update && sudo $apt_pref dist-upgrade'
+ alias adus="sudo $apt_pref update && sudo $apt_pref-s dist-upgrade"
alias afu='sudo apt-file update'
alias ag='sudo $apt_pref upgrade'
alias ai='sudo $apt_pref install'
View
22 themes/zalew.zsh-theme
@@ -0,0 +1,22 @@
+# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
+local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
+
+local user='%{$fg[green]%}%n%{$reset_color%}'
+local user_host='%{$fg[green]%}%n@%m%{$reset_color%}'
+local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}'
+
+local git_branch='$(git_prompt_info)%{$reset_color%}'
+local hg_info='$(hg_prompt_info)'
+local android_info='$(android_prompt_info)'
+
+PROMPT="╭─${user} ${current_dir} ${android_info}${git_branch}${hg_info}
+╰─%B$%b "
+RPS1="${return_code}"
+
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
+ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}"
+ZSH_THEME_HG_PROMPT_PREFIX=$ZSH_THEME_GIT_PROMPT_PREFIX
+ZSH_THEME_HG_PROMPT_SUFFIX=$ZSH_THEME_GIT_PROMPT_SUFFIX
+
+ZSH_THEME_ANDROID_PROMPT_PREFIX="%{$fg[green]%}‹"
+ZSH_THEME_ANDROID_PROMPT_SUFFIX="› %{$reset_color%}"
Something went wrong with that request. Please try again.