The Nim compiler offers a set of tools intended for use in IDEs ant text-editors that help with this. Besides the style insensitive grep, there are also a compiler-assisted "go to definition" and "list references" commands.
Is it not good enough to have specific grep tools? nimgrep for example, and there are procs for working with this IIRC.
I prefer to have a consistent code base, then I can use the internal tools of my editor, which are not aware of Nim's identifier rules.