Add these 2 features in zoxide, 1. Add multiple directories path, 2. Remove multiple paths
I deleted zoxide 2 times because it was not fast and i watched some youtube videos and found out i don't have any paths in zoxide database so i added all paths of those directories i regularly visit's using zpath_add and removed some paths that are not important using zpath_remove.
Now my zoxide setup 10x faster than before Please add these feature in zoxide it will more fast because zoxide written in rust.
zpath_add() {
for base in "$@"; do
find "$base" -type d -print0
done | while IFS= read -r -d '' dir; do
zoxide add "$dir"
#echo "✅ Added: $dir"
done
}
# zpath_add ~/.config ~/.garudrecon ~/some/other/path
# Recursive Add all directories path from input directories
~/.config
~/.config/waymore
~/.config/waymore/results
zpath_remove() {
zoxide query -l | grep -E "$1" | while read -r dir; do
zoxide remove "$dir"
#echo "❌ Removed: $dir"
done
}
# zpath_remove "~/.config|~/.garudrecon|sourcemapper"
# remove all paths anywhere input matches, e.g. "sourcemapper"
~/.garudrecon/scans/xyz.app/sourcemapper/cc-fe
~/.garudrecon/scans/xdfhfr.com/sourcemapper/gjh-pkj
Maybe I'm missing something, but entering a new directory with z path/to/directory should add it to your zoxide database. Currently, zoxide add already takes list of directories as an argument, so I'm not really sure what the feature you're requesting is.
@ajeetdsouza Unless I'm missing something about what @rix4uni is asking, I think this issue should be closed.
ls -l ~/.config
amass
chaos
favinfo
This will only add single directory path
zoxide add ~/.config
e.g.
~/.config
This will add all directory paths exists in ~/.config
zpath_add ~/.config
e.g.
~/.config/amass
~/.config/chaos
~/.config/favinfo
We don't have to add all directory manually.
We could probably add a --recursive flag, but for now, you can do this easily within your shell:
zoxide add **/
zoxide remove **/
I think zoxide add **/ going to add all of paths in /root, if yes it will not work for me because millions of temporary file exist in my system
zpath_add adds recursively for specific directory as per users need, you can implement later --recursive flag if you don't have time now
@rix4uni **/ is a glob that means "recurse through every directory in my current directory".
i.e. if you cd /home/me/Documents and run this command, it will add every directory inside /home/me/Documents, same as writing /home/me/Documents/**/.
Thanks bro
Leaving this open since it's a valid feature request.
Ok
i can work on adding this.