summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.zsh/prompt14
-rw-r--r--.zshrc6
2 files changed, 19 insertions, 1 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='[%?]'
diff --git a/.zshrc b/.zshrc
index b516b3b..675aabd 100644
--- a/.zshrc
+++ b/.zshrc
@@ -6,9 +6,13 @@ SAVEHIST=1000
# The following lines were added by compinstall
zstyle :compinstall filename '/home/oliver/.zshrc'
-autoload -Uz compinit
+autoload -Uz compinit promptinit
compinit
+promptinit
# End of lines added by compinstall
# Alias definitions.
[[ -f ~/.zsh/aliases ]] && source ~/.zsh/aliases
+
+# Prompt definitions.
+[[ -f ~/.zsh/prompt ]] && source ~/.zsh/prompt