A community-driven vim distribution
This layer provide tags manager for project. This layer need
core layer’s project manager feature.
To use gtags layer, you first have to install GNU Global.
You can install global from the software repository of your OS; however, many OS distributions are out of date, and you will probably be missing support for pygments and exuberant ctags, and thus support for many languages. We recommend installing from source.
If not for example to install on Ubuntu:
sudo apt-get install global
Install on OSX using Homebrew:
brew install global --with-pygments --with-ctags
Build from source:
To take full advantage of global you should install 2 extra packages in addition to global: pygments and ctags (exuberant). You can do this using your normal OS package manager, e.g., on Ubuntu
sudo apt-get install exuberant-ctags python-pygments
or e.g., Archlinux:
sudo pacman -S ctags python-pygments
Download the latest tar.gz archive, then run these commands:
tar xvf global-6.5.3.tar.gz cd global-6.5.3 ./configure --with-exuberant-ctags=/usr/bin/ctags make sudo make install
Configure your environment to use pygments and ctags:
To be able to use pygments and ctags, you need to copy the sample gtags.conf either to /etc/gtags.conf or $HOME/.globalrc. For example:
cp gtags.conf ~/.globalrc
Additionally you should define GTAGSLABEL in your shell startup file e.g. with sh/ksh:
echo export GTAGSLABEL=pygments >> .profile
To use this configuration layer, update custom configuration file with:
[[layers]] name = "gtags"
gtags layer provides following options:
gtagslabel: the backend of gtags command, you can use
pygments. It is empty string by default.
for example, to use pygments as backend:
[[layers]] name = "gtags" gtagslabel = "pygments"
Before using the gtags, remember to create a GTAGS database by
SPC m g c.
The database will also be updated automatically when saving files.
If you do not have
pygments enabled gtags will only produce tags for the following languages:
If you have enabled
exuberant ctags and use that as the backend
the following additional languages will have tags created for them:
Instead, If you have installed the newer/beta universal ctags and use that as the backend the following additional languages will have tags created for them:
In order to look up symbol references for any language not in the built in parser you must use the pygments backend. When this backend is used global actually uses both ctags and pygments to find the definitions and uses of functions and variables as well as “other symbols”.
If you enabled pygments (the best choice) and use that as the backend the following additional languages will have tags created for them:
||create a tag database|
||manually update tag database|
||jump to a file in tag database|
Hosted on GitHub, Help improve this page — Theme by mattgraham,