Skip to content

Instantly share code, notes, and snippets.

@folke
Created Oct 1, 2020
Embed
What would you like to do?
Using `apropos` on macos rebuilds the whatis database every time. Fish shell uses apropos for command completion.
# Fixes extremely slow apropos command on macos
# Using `apropos` on macos rebuilds the whatis database every time.
# Fish shell uses apropos for command completion.
# Simply add the file below to `~/.config/fish/conf.d` to fix the issue
set db ~/.whatis.db
function apropos_update
echo "Updating apropos / whatis database at $db"
man --path | tr ":" " " | xargs /usr/libexec/makewhatis -o $db
end
function apropos
[ -f $db ] || apropos_update
/usr/bin/grep -i "$argv" $db
end
function whatis
[ -f $db ] || apropos_update
/usr/bin/grep -i "\b$argv\b" $db
end
@montaro

This comment has been minimized.

Copy link

@montaro montaro commented Dec 9, 2020

Thanks a million!

@folke

This comment has been minimized.

Copy link
Owner Author

@folke folke commented Dec 10, 2020

@montaro

This comment has been minimized.

Copy link

@montaro montaro commented Dec 10, 2020

Thanks again @folke you saved me from migrating to Zsh :)

@VIVelev

This comment has been minimized.

Copy link

@VIVelev VIVelev commented Dec 18, 2020

Yeah, same. Thanks @folke!

@massyah

This comment has been minimized.

Copy link

@massyah massyah commented Jan 13, 2021

Thanks !

@chrisfcarroll

This comment has been minimized.

Copy link

@chrisfcarroll chrisfcarroll commented Jan 27, 2021

👍 ta!

@rodrigobdz

This comment has been minimized.

Copy link

@rodrigobdz rodrigobdz commented Jun 22, 2021

Works! Thank you @folke!

@folke

This comment has been minimized.

Copy link
Owner Author

@folke folke commented Jun 22, 2021

@rodrigobdz this has been merged a while back and has since been released, so you should no longer need this if you're using the latest version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment