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

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

Qt4: how to send QString inside a struct via QSharedMemory -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -