summaryrefslogtreecommitdiffstats
path: root/.zsh
diff options
context:
space:
mode:
authorOlliver Schinagl <oliver@schinagl.nl>2016-02-22 16:25:28 (GMT)
committerOlliver Schinagl <oliver@schinagl.nl>2017-04-18 08:04:55 (GMT)
commit0c5a757de41de6fbafba3246e97d0375b8426e9b (patch)
treee8b7a21fa3bb11a8e79169ef548eb5616eda8435 /.zsh
parent3fa6586955df7921697a8c6cbba5313068f479d3 (diff)
downloaddotfiles-0c5a757de41de6fbafba3246e97d0375b8426e9b.zip
dotfiles-0c5a757de41de6fbafba3246e97d0375b8426e9b.tar.gz
dotfiles-0c5a757de41de6fbafba3246e97d0375b8426e9b.tar.bz2
zsh: slightly improve the prompt
Diffstat (limited to '.zsh')
-rw-r--r--.zsh/prompt14
1 files changed, 14 insertions, 0 deletions
diff --git a/.zsh/prompt b/.zsh/prompt
new file mode 100644
index 0000000..17e578d
--- /dev/null
+++ b/.zsh/prompt
@@ -0,0 +1,14 @@
+# functions
+function git_prompt_info {
+ git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
+}
+
+# Load colors
+autoload -U colors && colors
+
+setopt promptsubst
+local CUR_BRANCH='$(git_prompt_info)'
+
+PROMPT="%{$fg[blue]%}[%{$fg[yellow]%}%n%{$fg[blue]%}@%{$fg[green]%}%m%{$fg[yellow]%}:%~%{$fg[blue]%}]%{$fg[red]%}${CUR_BRANCH}%{$fg[green]%}%# %{$reset_color%}"
+
+RPROMPT='[%?]'