Skip to content

Instantly share code, notes, and snippets.

@MattiJarvinen-BA
Last active April 23, 2021 06:44
Show Gist options
  • Select an option

  • Save MattiJarvinen-BA/bc25f9b95095bc282e7cd3250a30a1d1 to your computer and use it in GitHub Desktop.

Select an option

Save MattiJarvinen-BA/bc25f9b95095bc282e7cd3250a30a1d1 to your computer and use it in GitHub Desktop.
Got tired of too long ZSH directory names with oh-my-zsh agnoster theme. To be placed in .oh-my-zsh/custom/themes/agnoster.zsh-theme
source $ZSH/themes/agnoster.zsh-theme
# Dir: current working directory
# %1 for one dir
# %2 for 2 you get it eventually
prompt_dir() {
prompt_segment blue black '%1~'
}
PROMPT='%{%f%b%k%}$(build_prompt) '
@MattiJarvinen-BA
Copy link
Author

  • Works by including the original agnoster theme at first then overriding prompt_dir method.
  • PROMPT has to be redifined for changes to take effect.
  • Changes/updates from the repository (if not related to the PROMPT variable) should work.

What is Oh My Zsh? > https://github.com/robbyrussell/oh-my-zsh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment