Since I just ran some cscope benchmarks, I thought it'd be interesting
to run the exact same tests with GNU global. Here I use the gtags-cscope frontend.
Code diving through unfamiliar source bases is something we do far more often than
write new code from scratch--make sure you have the right gear for the job. (by George V. Neville-Neil)
The GNU Global package is highly recommended for using a single tags file,
covering all files in all subdirectories, that lives at the base of a source-code tree.
GNU global is a very compelling way to quickly search your project
for function definitions. Here I show how to index your code and update
it automatically when using git.
Grep shortcomings, the program intend to read other people's code,
you can consider the use like gtags to this tool. gtags GNU Global
source code tag system. (by Chien-Hsing Wang)
The reason I shifted to gtags is because ctags is no longer sufficient to me.
I have to trace the codes from large volume than last time, and they scatter
into many different folders.
In any case, after trying all the above tools (comment: other tag systems), I settled on gnu global,
although it took some work to get it working with VIM and my setup.
That's what this post is really about: documenting my usage of VIM and gnu global.
@ryogrid/gtags-mcp is an MCP (Model Context Protocol) server
that provides AI coding agents like Claude Code with powerful
codebase analysis capabilities using GNU GLOBAL (gtags).
This is a simple project to enable GNU global integration with Emacs xref,
project, completion-at-point (capf) and imenu with emphasis on tramp support
and simplicity.
Async plugin for Vim/NeoVim to ease the use of ctags/gtags. It is used for generate
and maintain tags for you with multiple platform support, tested on Windows/Linux/macOS.
gen_tags.vim will detect SCM(git, hg, svn) root and use it as the project root path.
Generate/Update ctags and gtags will run in background.
bundler-gtags command creates gtags for all bundled gems.
And also manages direnv settings exporting GTAGSLIBPATH
so that editors can tag-jump directly to any gems source code
from the bundler application.
Ajoke is a tool for doing Java programming on Emacs.
It is inspired by Emacs-Eclim, but does not depend on Eclipse.
Instead, it uses GNU Global and ctags-exuberant extensively, with a bunch of Perl scripts.
Videm (Vim's IDE Mode) is a C/C++ IDE based on vim (will become a common IDE
framework in future, I think). Videm use Cscope and GNU Global as symbol database.
helm-gtags.el is GNU Global helm interface.
helm-gtags.el is not compatible anything-gtags.el. But helm-gtags.el is designed
for faster search than anything-gtags.el. Now it suppors TRAMP.
jEdit is a mature programmer's text editor with hundreds (counting the time
developing plug-ins) of person-years of development behind it.
GlobalPlugin
provides an interface to the GNU Global source tagging tool.
GNU cflow analyzes a collection of C source files and prints a graph,
charting control flow within the program. You can include this output
in your htags hypertext using '--cflow=(cflow's output)'.
A plug-in for GNU Global which tags OCaml source code, using CamlP4 for versions
3.10 of OCaml and above. Provides ocaml_tags, which creates tags for ml and mli
files, and an ogtags script that wraps a gtags call with the ocaml_tags plug-in.
CEDET is a Collection of Emacs Development Environment Tools written with the end goal of
creating an advanced development environment in Emacs.
The Symbol References tool in CEDET can use GNU Global as an external tool.
`anything-gtags-select' is `anything' interface of `gtags-find-tag'.
`anything-c-source-gtags-select' is a source for `gtags-find-tag'.
Replace *GTAGS SELECT* buffer with `anything' interface.
Xgtags.el provides an interface to the Global cross-referencing tools.
While gtags.el, that comes with the Global distribution, is more a
replacement for emacs' own find-tag/pop-tag-mark facility with some
extra stuff, xgtags.el tries to permit the same functionality as
gtags.el, but behaves more like xcscope.el, the emacs interface for
cscope (http://cscope.sourceforge.net).
Doxygen is a documentation system for C++, Java, IDL and C.
Doxygen Release 1.4.3 includes new configuration option USE_HTAGS.
When enabled in combination with SOURCE_BROWSER=YES,
the source browser of htags(1) is used instead of doxygen's own.
This facility needs GLOBAL-4.8.6 or the later.
Elvis is a vi clone written by Steve Kirkendall,
which has two variables "tagprg" and "tagprgonce" for running
an external tag search program. You can use them with Global.
Emacs is the extensible, customizable, self-documenting real-time
display editor, written by Richard Stallman.
You can use this program as a front end of Global using gtags.el
which is part of the Global package.
ID utilities is a very powerful token tag system for generic text file.
Its index file is very small and searching is very fast.
You can call this command from global(1).
Bash is the shell, or command language interpreter,
that will appear in the GNU operating system.
You can use bash as a special shell for Global by Globash which
is included in Global package.
Automake is a tool for automatically generating `Makefile.in'
files compliant with the GNU Coding Standards. Automake supports
Global by its GTAGS target.
This software is a plug-in parser for GNU Global.
Uses Pygments, which is a syntax highlighter written in Python,
to extract tags. Supports wide variety of programming languages
thanks to Pygments.
JFlex is a lexical analyzer generator for Java, written in Java.
It is also a rewrite of the very useful tool. JLex which was developed
by Elliot Berk at Princeton University.
Clang is a compiler front end for the C, C++, Objective-C, and Objective-C++ programming languages.
It includes a single unified parser for the language above.
Semantic is an infrastructure for parser based text analysis in Emacs.
It is a lexer, parser-generator, and parser. It is written in Emacs Lisp
and is customized to the way Emacs thinks about language files,
and is optimized to use Emacs' parsing capabilities.
This is a parser library aimed at developers of free IDEs.
SourceBase aims to make parsing based features easy to implement.
These include intellisense code completion, producing call graphs
and dependency trees, etc.
Dumb Jump is an Emacs "jump to definition" package with support for 40+ programming
languages that favors "just working". This means minimal -- and ideally zero --
configuration with absolutely no stored indexes (TAGS) or persistent
background processes.
Cquery is a highly-scalable, low-latency language server for C/C++/Objective-C.
It is tested and designed for large code bases like Chromium.
cquery provides accurate and fast semantic analysis without interrupting workflow.
Clangd understands your C++ code and adds smart features to your editor:
code completion, compile errors, go-to-definition and more.
clangd is a language server that implements the Language Server Protocol;
it can work with many editors through a plugin.
clangd is based on the Clang C++ compiler, and is part of the LLVM project.
clang-tags is a C / C++ source code indexing tool. Unlike many other indexing tools,
clang-tags relies on the clang compiler (via the libclang interface) to analyse and
index the source code base.
The Language Server protocol is used between a tool (the client) and a language
smartness provider (the server) to integrate features like auto complete,
go to definition, find all references and alike into the tool.
An enhanced php ctags index file generator compatible with
http://ctags.sourceforge.net/FORMAT. Using PHP_Parser as PHP syntax parsing backend,
written in pure PHP. The generated ctags index file contains scope and access
information about class's methods and properties.
Hothasktags generates ctags files for Haskell, with knowledge of import
lists and qualified imports. It provides a smart go-to-definition for Vim,
that almost always gets it right in the presence of multiple names from different modules.
Cxxtags is a tool to tag(index) C/C++ source files based on clang.
The major difference from ctags is C++ support. C++ syntax
(ex. class, namespace, template, etc.) is supported(not fully yet though).
And generated tag file is a sqlite3 database file.
So you can access tag information via sqlite3 queries.
RTags is a client/server application that indexes c/c++ code and keeps a persistent
in-memory database of references, declarations, definitions, symbolnames etc.
It allows you to find symbols by name (including class and namespace scope).
Most importantly we give you proper follow-symbol and find-references support.
Exuberant Ctags is a reimplementation of the ctags(1), written by Darren Hiebert.
It is very robust in parsing code and supports many languages and many environments.
Universal Ctags took this over already.
You can create a TAGS file by calling the etags program that comes as a part of the Emacs
distribution. Usually, etags is compiled and installed when Emacs is built.
Code Search is a tool for indexing and then performing regular expression searches
over large bodies of source code. It is a set of command-line programs written in Go.
Cgrep is a grep tool suitable for searching in large code repositories.
It supports 30 programming languages and searches that go beyond the simple
pattern matching. It enables context-aware filtering and semantic searches
through wildcard and combinators.
Grab is another faster grep alternative that tries to use multiple cores.
It also uses parallel processing, mmap and other speedy tricks behind the scenes.
Ripgrep is a line-oriented search tool that recursively searches your current directory
for a regex pattern while respecting your gitignore rules. ripgrep has first class
support on Windows, macOS and Linux, with binary downloads available for every release.
ripgrep is similar to other popular search tools like The Silver Searcher, ack and grep.
A grep program configured the way the author like it, he wrote grin to help himself
search directories full of source code. It is written in Python by Robert Kern.
A replacement for (or supplement to) the grep family, glark offers: Perl compatible
regular expressions, highlighting of matches, context around matches,
complex expressions (``and'' and ``or''), and automatic exclusion of non-text files.
Ack is a tool like grep, optimized for programmers.
Designed for programmers with large heterogeneous trees of source code,
ack is written purely in portable Perl 5 and takes advantage of the power of
Perl's regular expressions.
Rak is a grep replacement in pure Ruby. It accepts Ruby syntax regular
expressions and automatically recurses directories, skipping .svn/, .cvs/, pkg/
and more things you don't care about. It is based on the Perl tool ack by Andy Lester.
CodeLite is an open-source, cross platform IDE for the C/C++ programming
languages (build and tested on Windows XP SP3, Windows Vista, Windows 7,
Ubuntu 10.04, and Mac OSX 10.5.8).
The VCF Builder is an advanced development tool for creating C++ applications,
and supporting a wide number of plug-ins for enhancing it's functionality.
NetBeans refers to both a platform framework for Java desktop applications,
and an integrated development environment (IDE) for developing with Java,
JavaScript, PHP, Python, Ruby, Groovy, C, C++, Scala, Clojure, and others.
Sourcetrail uses static analysis to provide code search and dependency
visualization that lets you understand, refactor and maintain unfamiliar
source code.
Hound provides a centralized web front-end to a regex-searchable text index of
multiple Git repositories. It was created by engineers at Etsy to handle searching
across codebases.
Elixir is a source code cross-referencer inspired by LXR. It's written
in Python and its main purpose is to index every release of the Linux kernel
while keeping a minimal footprint.
Tern is a stand-alone code-analysis engine for JavaScript.
It is intended to be used with a code editor plugin to enhance
the editor's support for intelligent JavaScript editing.
A new tool built atop the static analysis libraries under construction
in the go.tools repository. The oracle is designed to answer, quickly
and precisely, a range of questions about your Go program, such as
"where can this dynamic call dispatch to?" or "who sends values on this channel?".
Erlcscope builds a cscope compatible database for erlang files.
The database can be used with any program which supports cscope
along with the standard cscope -d command.
A code-understanding, code-browsing or code-search tool.
This is a tool to index, then query or search C, C++,
Java and Python source code. It builds upon the databases of cscope and ctags,
and provides a nice GUI tool.
SrcExpl (Source Explorer) is a source code explorer that provides context
for the currently selected keyword by displaying the function or type definition or
declaration in a separate window. This plugin aims to recreate the context window
available in the IDE known as "Source Insight".
Code Search is a tool for indexing and then performing regular expression
searches over large bodies of source code.
It is a set of command-line programs written in Go.
Binary downloads are available for those who do not have Go installed.
It is line-oriented source code search engine and search app.
It is possible to find the line containing the desired keyword
from the order of several tens of thousands of files instantly.
This project provides the ability to generate call graphs to aid the task
of understanding code. It uses a highly modular set of collection methods
and can be adapted to support any language although only C and C++ are
currently supported. Each collection method has different advantages
and disadvantages.
The SilentBob is yet another indexing tool helping you to find your way through
the software source code. Although SilentBob is also able to index sources in
many popular programming languages, currently C/C++ is the most functional back-end.
OpenGrok is a fast and usable source code search and
cross reference engine. It helps you search, cross-reference and
navigate your source tree. It can understand various program file
formats and version control histories like SCCS, RCS, CVS and
Subversion. It is written in Java.
PHPXref is a developer tool that's designed to ease the process
of working on large PHP projects by making it very fast and
easy to browse the code documentation along with the code itself.
ncc is a compiler that produces program analysis information.
ncc is a decent replacement of cflow and cscope able to analyse
any program using the gcc compiler.
A general purpose source code indexer and cross-referencer that
provides web-based browsing of source code with links to the
definition and usage of any identifier. Supports multiple languages.
TagSearch is a command line tool for searching Tags in Exuberant
ctags Files. - Search for special tag kind (classes, variable
definitions ...) - configurable output format - search case
sensitive/insensitive - search for partial or full Match.
Freescope is a programmer tool that provides source code browsing on
UNIX-like operating systems. It is a clone of the cscope program
but has its own unique features such as symbol completion and easy
result browsing.
The "Tag List" plug-in is a source code browser for the Vim editor.
It provides an overview of the structure of source code files and
allows you to efficiently browse through source code files
in different programming languages.
Cxref is a C source code cross referencing and documenting program
for UNIX, written by Andrew M. Bishop.
Cxref makes both html and latex style document.
Cscope is a developer's tool for browsing program code.
The cscope code has been released as Open Source by
Santa Cruz Operation, Inc. (SCO) under the BSD license.
Source-Navigator is a source code analysis tool by Source-Navigator Team.
With it, you can edit your source code, display relationships
between classes and functions and members, and display call trees.
It is distributed under GPL.
hypersrc is an open-source GUI program for browsing source code.
It displays a list of sorted source code tags and a tree view of functions.
A programmer can click a tag to hyperlink to its line in a source code file.
ECB is source code browser for Emacs.
It is a global minor-mode which displays a couple of
windows that can be used to browse directories, files and methods.
It supports method parsing for Java, C, C++, Elisp etc.
Htmlfontify provides a means of converting individual emacs buffers,
source files, or entire source trees to html, preserving formatting
and emacs colourisation / syntax highlighting as much as possible
through careful application of CSS style-sheets and html tags.
Source-highlight, given a source file, produces a document with syntax
highlighting. This package can handle Java, Javascript, C,C+, Prolog,
Perl, Php3, Python, Flex, ChangeLog and Ruby as source languages, and
HTML, XHTML and ANSI color escape sequences as output formats.
cldoc is a Clang based documentation generator for C and C++.
cldoc tries to solve the issue of writing C/C++ software documentation
with a modern, non-intrusive and robust approach.
phpDocumentor is the world standard auto-documentation tool for PHP.
Written in PHP, phpDocumentor can be used directly from the
command-line, or through an easy to use web interface.
ROBODoc is a documentation tool. It extracts specially formatted
comment headers from the source file and puts them in a separate file.
ROBODoc thus allows you to include the program documentation
in the source code and avoid having to maintain two separate documents.
Doxygen is a documentation system for C++, Java, IDL
(Corba, Microsoft and KDE-DCOP flavors) and C.
You can select output format in HTML, LaTeX, RTF (MS-Word),
PostScript, hyperlinked PDF, compressed HTML, and Unix man pages.
Synopsis is a general source code documentation tool.
By means of a modular structure it adapts to different styles of
embedded documentation, different programming languages and various
output formats. It scales well with the size of the project
by allowing processing to be controlled by Makefiles.
CWEB is a version of WEB for documenting C, C++, and Java programs.
WEB was adapted to C by Silvio Levy in 1987, and since then both
Knuth and Levy have revised and enhanced the system in many ways,
notably to support C++ and ANSI C. Thus CWEB combines TeX with
today's most widely used professional programming languages.
This site provides experimental source code browsing for the FreeBSD and
Linux kernels by Robert Watson, based on the software provided by the
LXR Project.
MINIX 3 is a new open-source operating system designed to be highly reliable,
flexible, and secure. It is loosely based somewhat on previous versions of MINIX,
but is fundamentally different in many key ways.
OpenIndiana is a community supported operating system, based on the illumos kernel.
It seems that it is a successor of OpenSolaris created by Sun Microsystems.
Copyright (c) 2000-2023 Tama Communications Corporation Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2