this command takes as input a search string, saves the output of findstr (Windows recursive search tool on cmd) to args, and passes that to notepad++.
-multiInst -nosession is used to force all results to open in the same window, and make that a separate instance from other existing windows of npp.
-addTitle= was supposed to help me recognize which window is for which search result. To be honest, that doesn’t work that well, since on the alt tab screen titleAdd applies at the end of the filename and not before so you can’t really tell … for that, maybe i can make a change request on the codebase since its open source but i doubt they’ll accept it. Or maybe there’s a setting somewhere
cmd /v:on /c "set search=search_term & set args= & (for /f %F in ('findstr /SM !search! *.*') do set args=!args! "%F" & set args=!args!) & start notepad++ -titleAdd=!search! -nosession -multiInst !args! & echo !args!"
I would like to improve this command. Some possible features that would be nice:
Support multiple search terms, ie. string1, string2, string3, string4, string5, string6 were my search terms. I would want to show all matching files for each term in a new window. Equivalent to running the original command six times
Enter search term after command, so i don’t have to keep hitting left-arrow until i get to the middle of the entered command and then delete the old string and enter new string.
Support spaces in search term
Create npp session file. Load session file.
I guess the real solution here would be to run an actual IDE rather than just CMD and Notepad++ but that’s all my (current) PC has. Just wanted something useful in scenarios where I don’t have access to an IDE or batch files for whatever reason or don’t want to run it.