Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Make home shorthand configurable for dir prompt #461

Merged
merged 1 commit into from
Apr 12, 2017

Conversation

julienfalque
Copy link
Contributor

@julienfalque julienfalque commented Mar 31, 2017

Replaces ~ at the beginning of the directory for dir prompt, just like /. Not sure about the variable name, please tell me if you have a better idea :)

@dritter
Copy link
Member

dritter commented Mar 31, 2017

Ha! Awesome! Thanks for your contribution.
I would have named it POWERLEVEL9K_SHORTEN_HOME_DELIMITER.. What do you think?

@julienfalque
Copy link
Contributor Author

I don't think it can be considered as a delimiter. What about POWERLEVEL9K_DIR_LEADING_TILDE?

@dritter
Copy link
Member

dritter commented Apr 2, 2017

Yes, naming it "delimiter" was my initial reflex, because I wanted it to make similar to the other replacement variable (which is POWERLEVEL9K_SHORTEN_DELIMITER). But you are probably right. Neither my suggestion nor the delimiter name is very good.

So. How about POWERLEVEL9K_HOME_FOLDER_ABBREVIATION?

We should rename the old variable at some point to POWERLEVEL9K_FOLDER_ABBREVIATION.. 🤔

@julienfalque julienfalque force-pushed the dir-home branch 2 times, most recently from 400da1e to 9297216 Compare April 2, 2017 11:22
@julienfalque
Copy link
Contributor Author

POWERLEVEL9K_HOME_FOLDER_ABBREVIATION seems good to me, I updated it.

@onaforeignshore
Copy link
Contributor

onaforeignshore commented Apr 2, 2017

Devil's advocate here - what if someone does POWERLEVEL9K_HOME_FOLDER_ABBREVIATION="Home Folder". Then it's hardly an abbreviation. Or if they want to replace the ~ with an icon, what then? Wouldn't POWERLEVEL9K_HOME_FOLDER be better then? (Using the KISS principle)

@dritter
Copy link
Member

dritter commented Apr 2, 2017

@onaforeignshore For that name you have to think outside of the box. I see you are coming from replacing ~ with something longer is not an abbreviation any more, but that train of thought is because you have seen the code / know that *nix OSes abbreviate the users home folder with a tilde.

For me that the OS abbreviates /home/user with ~ is the default value of POWERLEVEL9K_HOME_FOLDER_ABBREVIATION. We don't set it with our set_default function, because it is already done. If this was our code that name would make total sense. And from the outside perspective it looks like we are doing this..

POWERLEVEL9K_HOME_FOLDER is not specific enough in my opinion..

@bhilburn
Copy link
Member

bhilburn commented Apr 3, 2017

I think this is a neat idea! Thanks for contributing, @julienfalque!

One item before I merge it: can you update the README to include this new variable?

Regarding the name of the variable:
@dritter's suggestion does a good job of capturing how people will think about it, but @onaforeignshore raises an interesting point about what it actually represents. Interestingly, using ~ to represent $HOME is actually a BASH thing, and can be different from shell-to-shell. ZSH gets it from BASH. The technical name for it is the "BASH Tilde Expansion", in that it expands to $HOME. Here, we are going the opposite direction. I can't think of a name better than ABBREVIATION, though.

@bhilburn bhilburn self-assigned this Apr 3, 2017
@bhilburn bhilburn added the next label Apr 3, 2017
@onaforeignshore
Copy link
Contributor

@bhilburn if it is "BASH Tilde Expansion", the opposite would be CONTRACTION not ABBREVIATION, from a purely linguistic POV

@julienfalque
Copy link
Contributor Author

Updated the README file. About the variable name, I'm out of ideas too :)

This was referenced Apr 7, 2017
@bhilburn bhilburn merged commit 2be5d50 into Powerlevel9k:next Apr 12, 2017
@bhilburn
Copy link
Member

Thanks so much for the great contribution, @julienfalque! Nice work, and welcome to the project :)

@julienfalque julienfalque deleted the dir-home branch April 12, 2017 21:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants