From 00688ac163bda310eb9d5c0fb6b8bcde0ccd7010 Mon Sep 17 00:00:00 2001 From: Michael Sena Date: Thu, 6 Feb 2014 12:32:56 +1100 Subject: [PATCH 1/3] Added a function to retrieve the current git branch. Allows git prompt info when using ZSH+oh-my-zsh through Cygwin. --- lib/git.zsh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/git.zsh b/lib/git.zsh index 305a77aff..95152a5d8 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -7,6 +7,14 @@ function git_prompt_info() { fi } +git_prompt_info_quick() { + ref=$(git symbolic-ref HEAD) 2> /dev/null + if [ "${ref}" != "" ] + then + echo "git:${ref#refs/heads/}" + fi +} + # Checks if working tree is dirty parse_git_dirty() { From 119614a8e98c84deb526ecfb254d783af4f6f829 Mon Sep 17 00:00:00 2001 From: Michael Sena Date: Thu, 6 Feb 2014 12:35:02 +1100 Subject: [PATCH 2/3] My own oh-my-zsh theme. --- themes/meo.zsh-theme | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 themes/meo.zsh-theme diff --git a/themes/meo.zsh-theme b/themes/meo.zsh-theme new file mode 100755 index 000000000..0b4e718d1 --- /dev/null +++ b/themes/meo.zsh-theme @@ -0,0 +1,2 @@ +PROMPT="%{${fg_bold[white]}%}[%F{167}%2C%{${fg_bold[white]}%}] %(0?.%{${fg[blue]}%}.%{${fg[red]}%})$%{${reset_color}%} " +RPROMPT='%F{167} $(git_prompt_info_quick) %{${fg_bold[white]}%}%T%{${reset_color}%}' \ No newline at end of file From 14a4a0f202b2de5ff13d9e224c57395cb88a7f75 Mon Sep 17 00:00:00 2001 From: Michael Sena Date: Thu, 6 Feb 2014 12:48:18 +1100 Subject: [PATCH 3/3] Revert "My own oh-my-zsh theme." This reverts commit 119614a8e98c84deb526ecfb254d783af4f6f829. --- themes/meo.zsh-theme | 2 -- 1 file changed, 2 deletions(-) delete mode 100755 themes/meo.zsh-theme diff --git a/themes/meo.zsh-theme b/themes/meo.zsh-theme deleted file mode 100755 index 0b4e718d1..000000000 --- a/themes/meo.zsh-theme +++ /dev/null @@ -1,2 +0,0 @@ -PROMPT="%{${fg_bold[white]}%}[%F{167}%2C%{${fg_bold[white]}%}] %(0?.%{${fg[blue]}%}.%{${fg[red]}%})$%{${reset_color}%} " -RPROMPT='%F{167} $(git_prompt_info_quick) %{${fg_bold[white]}%}%T%{${reset_color}%}' \ No newline at end of file