ajeetdsouza/zoxide

Manual command to prune the database

Closed this issue ยท 3 comments

Hello! Loving zoxide so far, great tool, thank you! ๐Ÿš€

Like in issue #269 (and related #105), I was also wondering about the existence of a manual command to prune the database that removes nonexistent paths.

To provide a possible use case: I quite regularly create git worktrees to work on certain issues, and delete them afterward once they are resolved. Currently, the directories still pop-up as suggestions for 90 days before being removed, so it would be nice to have that command to be able to clean things up a bit faster. I guess it could just be a simple loop over all directories, and delete the db entries if they don't exist?

Cheers!

Directories that have been deleted should not show up in your query results at all. Where are you seeing these suggestions?

Dang, seems like I've been using https://github.com/jethrokuan/z in my fish shell setup all along ๐Ÿฅฒ and after removing it, the functionality does not actually work.

Not sure where it goes wrong, as I have zoxide installed, zoxide init fish | source in my config, and type z actually returns:

โ•ฐโ”€>$ type z
z is a function with definition
# Defined via `source`
function z --wraps=__zoxide_z --description 'alias z=__zoxide_z'
  __zoxide_z $argv

end

Think it's time to clean the setup a bit. If deleted directories aren't shown, that fixes my initial issue. Thanks for the clarification!

Awesome, closing this issue.