Join GitHub today
Integrate grepWin into Visual Studio
Integrating grepWin into Visual Studio
The simplest way to integrate grepWin into Visual Studio is to add it as an external tool. If you assign it a keyboard shortcut then, well, you've got grepWin at your fingertips and getting to it becomes super fast without needing to resort to the silly old mouse!
However, simply launching grepWin from within Visual Studio means you still need to provide the starting search path. Ideally you can get grepWin to use the project or solution path automatically. Looking into the extended documentation (the sources, that is, and particularly grepWin.cpp), you will be enlightened to discover that grepWin does indeed accept a command-line argument called
searchpath that specifies the search directory. It is used to fill the Search in field of the main grepWin screen on start-up. Given this, you can configure the external tool entry for grepWin to send it an argument of either
-searchpath:"$(SolutionDir)" depending on whether you wish to start the search within the current project or across the entire solution currently open. The best is, of course, to create an entry for both.
The following screenshot shows how to setup the external tool entry for grepWin to use the solution directory as the starting search path:
You may need to change the path to the grepWin executable specified in the Command field to reflect your installation. Unfortunately, the External Tools dialog of Visual Studio does not allow the use of environment variables, as in
The following screenshot shows how to setup the external tool entry for grepWin to use the current project directory as the starting search path:
Once again, you may need to change the path to the grepWin executable specified in the Command field to reflect your installation.