Skip to content

Instantly share code, notes, and snippets.

@iloveitaly
Last active October 30, 2024 17:36
Show Gist options
  • Save iloveitaly/b342092217821c92e6d478ca501af342 to your computer and use it in GitHub Desktop.
Save iloveitaly/b342092217821c92e6d478ca501af342 to your computer and use it in GitHub Desktop.
# make sure you execute this *after* asdf or other version managers are loaded
plugin_dir="${0:A:h}"
cache_file="$plugin_dir/_rg"
if (( $+commands[rg] )); then
if [[ ! -f "$cache_file" || ! $(/usr/bin/find "$cache_file" -mtime -15 2>/dev/null) ]]; then
rg --generate=complete-zsh > "$cache_file"
fi
# rg completion script cannot be executed directly
fpath+=$plugin_dir
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment