All Projects → jonathanklee → ngp

jonathanklee / ngp

Licence: GPL-3.0 license
Ncurses code parsing tool

Programming Languages

c
50402 projects - #5 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to ngp

The silver searcher
A code-searching tool similar to ack, but faster.
Stars: ✭ 23,030 (+44188.46%)
Mutual labels:  search-in-text, ag, silver-searcher
Termox
C++17 Terminal User Interface(TUI) Library.
Stars: ✭ 306 (+488.46%)
Mutual labels:  ncurses, curses
cxxcurses
Header only ncurses wrapper
Stars: ✭ 24 (-53.85%)
Mutual labels:  ncurses, curses
Rubiks cube
rubik's cube that runs in your terminal!
Stars: ✭ 73 (+40.38%)
Mutual labels:  ncurses, curses
Pdcurses
PDCurses - a curses library for environments that don't fit the termcap/terminfo model.
Stars: ✭ 604 (+1061.54%)
Mutual labels:  ncurses, curses
croatoan
Common Lisp bindings for the ncurses terminal library.
Stars: ✭ 111 (+113.46%)
Mutual labels:  ncurses, curses
Snoo
A Reddit command line client written in Node.js, using modern ES-features
Stars: ✭ 39 (-25%)
Mutual labels:  ncurses, curses
ncgrep
NCGREP, which is based on ncurses library to provide user interface, is a grep tool for searching text on target directory.
Stars: ✭ 23 (-55.77%)
Mutual labels:  ncurses, grep
Netbsd Curses
libcurses and dependencies taken from netbsd and brought into a portable shape (at least to musl or glibc)
Stars: ✭ 93 (+78.85%)
Mutual labels:  ncurses, curses
Dte
A small, configurable console text editor (moved to https://gitlab.com/craigbarnes/dte)
Stars: ✭ 98 (+88.46%)
Mutual labels:  ncurses, curses
Vifm
Vifm is a file manager with curses interface, which provides Vim-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Stars: ✭ 1,822 (+3403.85%)
Mutual labels:  ncurses, curses
Pacmixer
an alsamixer alike for PulseAudio.
Stars: ✭ 78 (+50%)
Mutual labels:  ncurses, curses
Tuicss
Text-based user interface CSS library
Stars: ✭ 167 (+221.15%)
Mutual labels:  ncurses, curses
ncurses
Ncurses bindings for Crystal
Stars: ✭ 20 (-61.54%)
Mutual labels:  ncurses, curses
textics
📉 JavaScript Text Statistics that counts lines, words, chars, and spaces.
Stars: ✭ 36 (-30.77%)
Mutual labels:  search-in-text
vim-agriculture
🚜 Vim plugin to improve project searching with tools like ag and rg
Stars: ✭ 119 (+128.85%)
Mutual labels:  ag
MiniGBS
Small .gbs chiptune player for Linux
Stars: ✭ 15 (-71.15%)
Mutual labels:  ncurses
deltachat-cursed
[WIP] Cursed Delta, a lightweight Delta Chat client for the command line
Stars: ✭ 33 (-36.54%)
Mutual labels:  curses
gf-patterns
Collection grep patterns for Tom Hudson a.k.a Tomnomnom tools namely gf
Stars: ✭ 27 (-48.08%)
Mutual labels:  grep
ogrep-rs
Outline grep — search in indentation-structured texts (Rust version)
Stars: ✭ 32 (-38.46%)
Mutual labels:  grep

Build Status

ngp

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 [email protected]:jonathanklee/ngp.git
cd ./ngp
cmake .
make
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.

Demo

Looking for "struct" pattern in ngp source code.

gif

License

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
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
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 <http://www.gnu.org/licenses/>.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].