xref: /Universal-ctags/README.md (revision 7b83896d48cec54954822642ffbf4353c7881cc1)
1# Universal Ctags
2
3[![Coverity Scan Build Status](https://scan.coverity.com/projects/4355/badge.svg)](https://scan.coverity.com/projects/4355)
4[![Coverage Status](https://coveralls.io/repos/universal-ctags/ctags/badge.svg?branch=master&service=github)](https://coveralls.io/github/universal-ctags/ctags?branch=master)
5[![Build status](https://ci.appveyor.com/api/projects/status/6hk2p5lv6jsrd9o7/branch/master?svg=true)](https://ci.appveyor.com/project/universalctags/ctags/branch/master)
6[![RTD build status](https://readthedocs.org/projects/ctags/badge)](https://docs.ctags.io)
7[![CircleCI Build Status](https://circleci.com/gh/universal-ctags/ctags.svg?style=shield&circle-token=2e582261da84ebc6d21725b05381f410bc5de29d)](https://circleci.com/gh/universal-ctags)
8![GitHub Actions/VALGRIND](https://github.com/universal-ctags/ctags/workflows/run%20units%20target%20under%20VALGRIND/badge.svg)
9
10[Universal Ctags](https://ctags.io/) (abbreviated as u-ctags) is a *maintained*
11implementation of `ctags`.
12`ctags` generates an index (or tag) file of language objects found in source
13files for programming languages.
14This index makes it easy for text editors and other tools to locate the indexed
15items.
16
17[Exuberant Ctags](http://ctags.sourceforge.net/) (e-ctags) maintained by Darren
18Hiebert, the ancestor of Universal Ctags, improved traditional `ctags` with
19multi-language support, the ability for the user to define new languages
20searched by regular expressions (called optlib in Universal Ctags), and the
21ability to generate emacs-style TAGS files.
22But the activity of the project unfortunately stalled.
23
24Universal Ctags has the objective of continuing the development of Exuberant
25Ctags.
26Reza Jelveh <reza.jelveh@gmail.com> initially created a personal fork of
27Exuberant Ctags on GitHub.
28As interest and participation grew, it was decided to move development to a
29dedicated project as Universal Ctags.
30The goal of this project is to maintain a common/unified working space where
31people interested in making ctags better can work together.
32
33Some of the major features of Universal Ctags are:
34
35* more numbers of improved language support
36    * new extended C/C++ language parser, etc.
37* fully extended optlib (a feature to define a new language parser from a
38  command line)
39* interactive mode (experimental)
40
41## The latest build and package ##
42
43If you want to try the latest Universal Ctags without building it yourself...
44
45### Windows
46Daily builds are available at the [ctags-win32](https://github.com/universal-ctags/ctags-win32) project.
47Go to the [releases](https://github.com/universal-ctags/ctags-win32/releases) page to download zip packages.
48
49### Mac
50See [Homebrew Tap for Universal Ctags](https://github.com/universal-ctags/homebrew-universal-ctags)
51
52### Snap
53Go to [ctags-snap](https://github.com/universal-ctags/ctags-snap) and
54clone the `ctags-snap` repo. Then, follow instructions to build the
55snap package of Universal Ctags. Snapcraft will automatically fetch the source
56code from GitHub.
57
58## How to build and install ##
59
60To build with Autotools (Autoconf and Automake) on GNU/Linux, OSX, or Windows 10 WSL,
61```
62    $ git clone https://github.com/universal-ctags/ctags.git
63    $ cd ctags
64    $ ./autogen.sh
65    $ ./configure --prefix=/where/you/want # defaults to /usr/local
66    $ make
67    $ make install # may require extra privileges depending on where to install
68```
69
70GNU make is assumed as the `make` command.
71
72See
73[`docs/autotools.rst`](https://github.com/universal-ctags/ctags/blob/master/docs/autotools.rst)
74for more information.
75
76To build on Windows, see
77[`docs/windows.rst`](https://github.com/universal-ctags/ctags/blob/master/docs/windows.rst)
78for more information.
79
80To build on OSX, see
81[`docs/osx.rst`](https://github.com/universal-ctags/ctags/blob/master/docs/osx.rst)
82for more information.
83
84## Manual ##
85The primary documents of Universal Ctags are man pages.
86Users should first consult the
87[ctags(1)](https://docs.ctags.io/en/latest/man/ctags.1.html), and [other man
88pages](https://docs.ctags.io/en/latest/man-pages.html) if necessary.
89
90[Universal Ctags Hacking Guide](https://docs.ctags.io), which also includes the
91man pages, is primarily for developers and provides additional information to
92the man pages, including experimental features.
93
94See also `*/README.md` on this repository.
95
96## Differences from exuberant-ctags ##
97
98You may be interested in how Universal Ctags is different from Exuberant Ctags.
99See
100[ctags-incompatibilities(7)](https://docs.ctags.io/en/latest/man/ctags-incompatibilities.7.html)
101and [Introduced changes](https://docs.ctags.io/en/latest/news.html) for details.
102
103The most significant incompatible changes:
104
105* Universal Ctags doesn't load `~/.ctags` and `./.ctags` at starting up time.
106  Instead, it loads `~/.ctags.d/*.ctags` and `./.ctags.d/*.ctags`.
107
108* Universal Ctags is more strict about characters that can be
109  used in kind letters and kind names than Exuberant-ctags.
110
111  - The letter must be an alphabetical character (`[a-zA-EG-Z]`).
112    `F` is reserved for `file` kind.
113
114  - The first character of the name must be alphabetic, and
115    the rest characters must be alphanumeric (`[a-zA-Z][a-zA-Z0-9]*`).
116
117  The detailed background is explained in
118  [#1737](https://github.com/universal-ctags/ctags/pull/1737).
119
120  If you want to reuse your `.ctags` written for Exuberant-ctags,
121  you must review kind letters and names defined with `--regex-<LANG>=...`
122  options. When updating the definitions, using `--kinddef-<LANG>=...` option
123  is appreciated.
124
125Pull-requests are welcome!
126