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

How to remove the unwanted paths from zi #499

Closed
c02y opened this issue Dec 9, 2022 · 4 comments
Closed

How to remove the unwanted paths from zi #499

c02y opened this issue Dec 9, 2022 · 4 comments

Comments

@c02y
Copy link
Contributor

c02y commented Dec 9, 2022

For instance, I use zi abc to list and choose the path I needed, but there are a few other paths in the list that are not frequently accessed, I need to remove those paths from the db so I can jump to abc directly without interactively choosing one.

But zoxide remove -i abc will list hundreds of paths, and it is difficult to filter the paths I needed.

Is there anything can I do to remove the paths from zi abc without listing all the paths in db?

@mattiasbonte
Copy link

I found the least time consuming endeavor to be, removing the existing database and start from scratch..

For example on Mac..~/Library/Application Support/zoxide the database file can be found here, but I don't recommend cleaning it manually.

Cheers.

@ajeetdsouza
Copy link
Owner

@c02y there is a way to remove directories via a script (zoxide remove) as well as interactively (zoxide remove -i). Both let you delete multiple entries in one go.

I didn't fully understand -- how do you think this process could be made faster? As @mattiasbonte said, if you're looking to purge the whole database, you may as well delete the database file itself and start over.

@ajeetdsouza ajeetdsouza added the waiting-for-response Waiting for a response from the issue author. label Jan 6, 2023
@c02y
Copy link
Contributor Author

c02y commented Jan 7, 2023

I only need zoxide remove -i (or maybe with extra flag) to list all and only paths in zi, since zoxide remove -i will list all the paths in db including the keyword in the middle of the path unlike zi abc only lists paths when abc is in the last part of the paths.

@github-actions github-actions bot removed the waiting-for-response Waiting for a response from the issue author. label Jan 7, 2023
@c02y
Copy link
Contributor Author

c02y commented Apr 8, 2023

a fish shell function:

function zd
    set path (zoxide query -i -- $argv)
    test $path; and zoxide remove $path
end

@c02y c02y closed this as completed Apr 8, 2023
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

3 participants