New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
agnoster theme - only show ~ as working directory #5479
Comments
@quang-ha I'm not sure about the Agnoster theme, however, you definitely can in Powerlevel9k. |
You can redefine the prompt_dir () {
prompt_segment blue black '~'
} Paste that at the end of your zshrc file and you should be good to go. |
@quang-ha you can also show only the current folder without the full path: prompt_dir() {
prompt_segment blue black "${PWD##*/}"
} |
@betogrun r u sure? What I am getting is this |
@hck94829 I'm not sure why it is no longer working. prompt_dir() {
prompt_segment blue $PRIMARY_FG " `basename ${PWD/#$HOME/'~'}` "
} More info: betogrun/agnoster-zsh-theme@3c57a1d |
@hck94829 Make sure you put in double quotes like this |
I do just: prompt_dir() {
prompt_segment blue black '%c'
} |
Technically '%c' is deprecated. Documentation recommends '%.' or '%1/'. |
What @georgealegre says, I tried '%.' and it does just that. Instead of the full path, it shows the current directory. Which I'd say it's good, because sometimes the full path would be so wide that there's almost no space left for commands... |
for me '%' or '~1' didn't work but as @fepegar said '%c' worked... |
Actually, I got that problem too, first. It's kind of embarrassing to say it, but I got the characters wrong. '%' and '~1' do nothing. It's '%.' and '~1/'. The dot and the slash, kind of easy not to see them. |
Here's what worked for me:
|
@betogrun comment works for me but how to show parent too? i want to show parent and current directory |
@SarKurd you can do
You can see more prompt expansion characters in the documentation. |
Is there a way to only show
~
instead of the full directory in theagnoster
theme? I kind of love the blue rectangle strip but again don't want to show the full working path.The text was updated successfully, but these errors were encountered: