It is possible to set Projectile to use Git's version of the grep command. If you have Git installed on Windows, simply applying the configuration below should suffice:
(setq projectile-use-git-grep t)
Another alternative would be to try to use Windows' findstr
command instead. One instance of a search that barely works is:
(defun grep-projectile-windows(&optional search-string)
(interactive)
(let ((search-string (or search-string (read-string "[search in project] string pattern: "))))
(shell-command-to-string (concat "findstr /s /i /p"
(concat "/c:\"" search-string "\" ")
(concat "\"" (replace-regexp-in-string "/" "\\" (projectile-project-root) t t) "*.*\"")))))
However, to have a fully working solution with this alternative, integration with Projectile would still be required by hacking into the package code, alongside better implementation of the command call (e.g., excluding undesided dirs such as .git
, etc.).
A third alternative is to use other search tools search as ag
or ack
, that have integration with Projectile via external packages.