Integrating The Silver Searcher with Vim's 'grepprg' (without any plugins)

Vim has a command called :grep (:help :grep), which is used for searching plain text across the project. Internally it uses the *nix grep utility to perform the search. However, the grep utility is very slow, especially for larger projects, which means you might want to use something else like ag (follow the instructions given in the official repo for installation). Understanding :grepWhen we execute let's say :grep text_to_find in Vim, it will look at the value of the option called 'grepprg' (:help 'grepprg'), replace $* with text_to_find, and then pass it to the shell for execution.