From d132f3a0ada8a64043fcad6f424cc543c4e1cc3c Mon Sep 17 00:00:00 2001 From: Andrei Dumitrescu Date: Thu, 2 Mar 2017 21:11:38 +0100 Subject: [PATCH] Moved git-info right after user@host and moved cursor on a new line Why did you do it? 1. Moving git-info makes sense because it's a better visual anchor, it's after a fixed width section (user@host) and you don't have to adjust when you change your git project. 2. Putting cursor on a new line also because it's a better anchor (always at the beginning of the line) and because I often find myself not having enough space to see the command properly because the path was to big and the command jumped on 2 lines. What exactly did you do? Changed the order in `prompt_agnoster_main` and added a new `prompt_cursor` function. --- agnoster.zsh-theme | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/agnoster.zsh-theme b/agnoster.zsh-theme index 8ca6d40d..a35b9ba7 100644 --- a/agnoster.zsh-theme +++ b/agnoster.zsh-theme @@ -27,7 +27,7 @@ CURRENT_BG='NONE' if [[ -z "$PRIMARY_FG" ]]; then - PRIMARY_FG=black + PRIMARY_FG=black fi # Characters @@ -131,15 +131,22 @@ prompt_virtualenv() { fi } +# Put cursor on a new line +prompt_cursor(){ + prompt_segment + print -n "\n$SEGMENT_SEPARATOR" +} + ## Main prompt prompt_agnoster_main() { RETVAL=$? CURRENT_BG='NONE' prompt_status prompt_context + prompt_git prompt_virtualenv prompt_dir - prompt_git + prompt_cursor prompt_end }