Ncurses grep tool.
ngp lets you look for a pattern in your source code directory and display results in ncurses.
ngp lets you browse results with ease.
ngp lets you open a result with your favorite editor at the right line.
-
Install build dependencies for your platform/distribution :
libconfig
,libpcre
&ncurses
-
Enter the following commands in your terminal :
cmake .
make
make install
- That's it. You can now open a terminal and enjoy !
ngp my_pattern
ngp implements it's own code source parser. You can also use an external tool to parse your source code.
Currently only ag
and git grep
are supported.
The default parser can be specified in your ~/.config/ngp/ngprc file.
Other available values for the 'default_parser' option are "ag" or "git". The parser can also be specified using command line arguments.
For example, ngp --ag -- pattern
will use ag
as a parser anbd will overwrite the 'default_parser' setting.
Please check ngp --help
for further information on command line arguments.
Your ngprc file also allows you to customize the commands for ag
and git grep
. Thus, you can add options for ag
like "-C"
or you can change a tools location if it's not in your $PATH.
Note that it is mandatory to specify the three arguments : options, pattern and path for each command.
Looking for "create" pattern in ngp source code.