zsh - Remove current directory if in Git repo -


i using agnoster theme oh-my-zsh in iterm2. possible hide current directory if you're in git repo avoid needless duplication, if how?

here gist of zsh setup

enter image description here

interestingly, the actual agnoster theme screenshot not duplicate directory (as expecting)

as noted @4ae1e1 can fork theme , include conditional.

in directory prompt here,

prompt_dir() {    prompt_segment blue black '%~' } 

include conditional display directory information if not in git directory, like

prompt_dir() {   if ! (git rev-parse --is-inside-work-tree >/dev/null 2>&1);      prompt_segment blue black '%~'   fi } 

Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -