Skip to content

Conversation

skelly37
Copy link
Contributor

@skelly37 skelly37 commented Aug 1, 2021

If anyone knows how to write it more clearly and the script (instead of the config one) way — feel free to correct it

If anyone knows how to write it more clearly and the script (instead of the config one) way — feel free to correct it
@fdncred
Copy link
Contributor

fdncred commented Aug 1, 2021

thanks. can you explain what this script does please? it's not clear to me looking at it in one line. :)

@skelly37
Copy link
Contributor Author

skelly37 commented Aug 1, 2021

thanks. can you explain what this script does please? it's not clear to me looking at it in one line. :)

It works like cd with modified $CDPATH in Bash. So you add desired locations to the cdpath variable, then if you use c [directory], it loops through your list and searches for the desires folder also in those places.

It's difficult for me to explain it but I hope you can understand now.

If not, check this article out: https://www.theunixschool.com/2012/04/what-is-cdpath.html?m=1

I've made use of selecting just directories instead of iterating over everything in a directory, increasing the speed of execution significantly
I have just noticed I had not documented the script well. Now it is the final version of my idea, I guess.
@fdncred
Copy link
Contributor

fdncred commented Aug 1, 2021

oh, ok. thanks for the explanation and the documentation. i kind of use zoxide for this. i just type z some_piece_of_a_dir and it cds anywhere i've ever cd'd before.

@fdncred fdncred merged commit cd89a63 into nushell:main Aug 1, 2021
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

Successfully merging this pull request may close these issues.

2 participants