You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of ~/User/Documents/folder1/folder2, I'd like to be able to just show /folder2 or maybe /folder1/folder2 so it doesn't take too much space. Is there a way for me to do this?
I'm looking at this section:
prompt_dir() {
prompt_segment blue black '%~'
}
but I don't really understand what it means.
The text was updated successfully, but these errors were encountered:
dsoegijono
changed the title
How can I show the last (1 or 2) path?
How can I show the last (1 or 2) path instead of full directory?
Jun 6, 2018
See the "Shell State" section of the Prompt Expansion page in the Zsh reference manual.
You can stick a number between the % and ~ to limit the number of trailing path elements that are displayed. So, you could do:
prompt_segment blue black '%2~'
to get the last two elements of the current directory.
See also the prompt-pwd function in Prezto. It does more advanced prompt "compaction", abbreviating all but the last path element with a single letter, so you still have more context about where you are.
Instead of
~/User/Documents/folder1/folder2
, I'd like to be able to just show/folder2
or maybe/folder1/folder2
so it doesn't take too much space. Is there a way for me to do this?I'm looking at this section:
but I don't really understand what it means.
The text was updated successfully, but these errors were encountered: