Skip to content
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

Feature/Question: Show directory instead of full path #562

Closed
jasonvarga opened this issue Sep 4, 2020 · 2 comments
Closed

Feature/Question: Show directory instead of full path #562

jasonvarga opened this issue Sep 4, 2020 · 2 comments

Comments

@jasonvarga
Copy link

Hi! Not a bug, but just a question.

Is it possible to just show the current directory instead of the entire path?

i.e. myproject instead of ~/projects/myproject

@mafredri
Copy link
Collaborator

This would be solvable by #460, if it gets implemented (but nobody is working on it atm).

Now, if you don't mind making your own changes / forking, it's a simple one line change 😄:

diff --git pure.zsh pure.zsh
index 2cbd7d0..d8326ae 100644
--- pure.zsh
+++ pure.zsh
@@ -135,7 +135,7 @@ prompt_pure_preprompt_render() {
 	[[ -n $prompt_pure_state[username] ]] && preprompt_parts+=($prompt_pure_state[username])
 
 	# Set the path.
-	preprompt_parts+=('%F{${prompt_pure_colors[path]}}%~%f')
+	preprompt_parts+=('%F{${prompt_pure_colors[path]}}%1~%f')
 
 	# Git branch and dirty status info.
 	typeset -gA prompt_pure_vcs_info

@jasonvarga
Copy link
Author

I don't mind at all. That works beautifully, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants