Hacker News new | ask | show | jobs
by 37ef_ced3 1547 days ago
Concatenate all the source code files into a single file, with pathnames inserted between files.

Then use Vim to read the concatenation and (regexp) search.

1 comments

What is the benefit of this approach versus searching the codebase using tools meant for codesearch? Doesn't this fall over for medium and larger codebases? For example, my current org has over a thousand projects in a single monorepo comprising millions of lines of code in a couple of different languages.
Do whatever works for you.

I use Vim on a concatenation. It's a simple technique that allows me to search, read, annotate, and understand how everything fits together in a medium sized C++ codebase full of templates (i.e., a pile of garbage).