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?
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
Post a Comment