Skip to content
Ncurses code parsing tool
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
src config file creation: Honor XDG_CONFIG_HOME Jul 8, 2019
.gitignore update .gitignore with ctags file Feb 10, 2016
CMakeLists.txt fix compilation with new gcc Oct 19, 2018
COPYING switch to GPL v3 Nov 23, 2016 added CI status in README Apr 26, 2018
ngp.gif introduce gif demo Mar 29, 2018

Build Status


ncurses grep

ngp lets you look for a pattern 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.

Build and Install

  1. Install build dependencies for your platform/distribution : libconfig, libpcre & ncurses

  2. Enter the following commands in your terminal :

git clone
cd ./ngp
cmake .
make install
  1. That's it. You can now open a terminal and enjoy !
ngp my_pattern

Native or External parser

ngp implements it's own parser but you can also use it with an external parser.

By default, ngp looks into the extensions listed in the ngprc configuration file. If you want to override those extensions with a specific extension, you can use the -t option :

ngp my_pattern -t my_extension

For instance, we can look for the LOCAL_MODULE expression in Android Open Source Project makefiles.

ngp LOCAL_MODULE -t mk

To look into all the files, the native parser has also a raw option.

ngp my_pattern -r

To look for a regular expression, the native parser implements the -e option.

ngp my_regexp -e

For instance, we can look for a regular expression like ^._MODULE :=.$

ngp "^.*_MODULE :=.*$" -e

Have a look at ngp -h for more options.

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 "struct" pattern in ngp source code.



Copyright (c) 2013 Jonathan Klee

ngp is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

ngp is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with ngp.  If not, see <>.
You can’t perform that action at this time.