From f1c0baf0f77309be9b7947a627f3fffe6f38270f Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 21 Jan 2020 12:17:23 +0000 Subject: [PATCH] Start customising prompt --- tag-zsh/zsh/configs/prompt.zsh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tag-zsh/zsh/configs/prompt.zsh diff --git a/tag-zsh/zsh/configs/prompt.zsh b/tag-zsh/zsh/configs/prompt.zsh new file mode 100644 index 0000000..7c76bad --- /dev/null +++ b/tag-zsh/zsh/configs/prompt.zsh @@ -0,0 +1,10 @@ +git_prompt_info() { + current_branch=$(git current-branch 2> /dev/null) + if [[ -n $current_branch ]]; then + echo " %{$fg_bold[green]%}$current_branch%{$reset_color%}" + fi +} + +setopt promptsubst + +export PS1='${SSH_CONNECTION+"%{$fg_bold[green]%}%n@%m:"}%{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) \$ '