Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
105 lines (81 sloc) 3.53 KB
name: universal-ctags
summary: Parse source code to build an index of defined symbols.
adopt-info: universal-ctags
description: |
ctags parses source code to produce an index file, mapping the names of
symbols, like functions, classes, and variables, to the locations where
they are defined. This index is used by editors like Vim and Emacs
to enable feaures like 'go to definition'.
Universal Ctags is a fork of the venerable Exuberant Ctags, that adds
additional features, including support for more languages.
## Usage
When installed, this snap provides executable `universal-ctags`,
and alias `ctags`.
In order to read config from files under `~/.ctags.d/`,
you need to give the snap permission.
This should be automated imminently, but for now:
sudo snap connect universal-ctags:dot-ctags
See ctags online useage documentation at
## Limitations
Compared to universal-ctags installed using apt, or compiled from source,
this snap currently has some limitations, introduced by snap security
1. Source files cannot be scanned if they are:
* Outside the user's $HOME directory, or
* In a top-level hidden directory, eg. `~/.src`.
However, it can scan source in lower-level hidden directories, eg.
2. Config is usually read from the following directories:
* User's `~/.ctags.d/` is read as expected. (But see the note
in 'Usage' about giving the snap permission.)
* Current directory's `ctags.d` is not read by default,
but the '--options' arg can be used to read from it.
* Current directory's `.ctags.d` cannot be read.
3. Configuration in other places, specified using `--options`
or `--options-maybe`, will not be read if they are outside the
user's HOME, or in a top-level hidden directory.
4. Tag files written using '-f' options or similar may not be outside
the user's $HOME directory, nor in a hidden file or directory at
top level in the $HOME directory. (You can work around this by
using `-f -` and redirecting stdout to the required location.)
5. The universal-ctags 'man' pages are not installed.
6. The 'etags' executable alias (which defaults to Emacs style tags files)
is not installed.
If these or other issues cause you problems, let me know at
base: core18
grade: stable
confinement: strict
interface: personal-files
read: [$HOME/.ctags.d]
plugs: [home, dot-ctags]
command: universal-ctags-wrapper
source-type: git
plugin: autotools
build-packages: [pkg-config]
stage-packages: [libxml2]
override-pull: |
snapcraftctl pull
snapcraftctl set-version "0.$(date -u +%Y-%m-%d+%H:%M:%S)+$(git show -s --format=%h)"
override-prime: |
snapcraftctl prime
echo >universal-ctags-wrapper '#!/usr/bin/env bash
# Wrapper around the ctags executable,
# to set HOME back to the user'"'"'s home dir,
# so that ctags can read config files in ~/.ctags.d/
# (Contained snaps set HOME to $SNAP_USER_DATA instead.)
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
HOME=$(python3 -SIBc '"'"'
import os, pwd
'"'"') $dir/bin/ctags $@
chmod a+x universal-ctags-wrapper
You can’t perform that action at this time.