ttscoff / fuzzy_cd

MIT License
6 stars 0 forks source link

Fuzzy matching symlinks #1

Open der-bingle opened 2 years ago

der-bingle commented 2 years ago

First off, I've been using this function for a couple months now, and it's straight up 🔥. Feels like this is the way cd always should have been. So thanks for this!

I have run into one little snag along the way: Because of the messy way iCloud Drive data is stored, I've started keeping a ~/.icloud directory that contains nothing but symlinks to the actual directories in ~/Library/Mobile Documents/. This allows navigating iCloud Drive in both the command line and Alfred to look identical to opening a Finder window.

But none of the symlinked directories ever match. cd icloud keynote, for instance, will always result in > No match found.

Thanks!

ttscoff commented 2 years ago

is "icloud" a jump mark, or are you relying on fasd to find the recent directory?

der-bingle commented 2 years ago

Yeah, it's a jump mark.

But just now after seeing your reply, I actually found the solution in the find manpage:

-L Cause the file information and file type (see stat(2)) returned for each symbolic link to be those of the file referenced by the link, not the link itself. If the referenced file does not exist, the file information and type will be for the link itself.

Added -L to find on line 36 in fcd_ffdir.fish, and now symlinked directories are being returned correctly! 🤓

ttscoff commented 2 years ago

Awesome, will test and update if it works for me!

Thanks, Brett

On 19 May 2022, at 14:10, derBingle wrote:

Yeah, it's a jump mark.

But just now after seeing your reply, I actually found the solution in the find manpage:

-L Cause the file information and file type (see stat(2)) returned for each symbolic link to be those of the file referenced by the link, not the link itself. If the referenced file does not exist, the file information and type will be for the link itself.

Added -L to find on line 36 in fcd_ffdir.fish, and now symlinked directories are being returned correctly! 🤓

-- Reply to this email directly or view it on GitHub: https://github.com/ttscoff/fuzzy_cd/issues/1#issuecomment-1132095771 You are receiving this because you commented.

Message ID: @.***>