Skip to content

gediminasz/ctags-companion

Repository files navigation

Ctags Companion

A Visual Studio Code symbols provider based on Ctags. This extension provides the following capabilities:

Usage

First of all, make sure you have Universal Ctags installed.

In order to provide symbol definitions a tags file must be present. You can generate it using the "rebuild ctags" task (Terminal > Run Task... and select "Ctags Companion: rebuild ctags"). It will run ctags and generate a tags file inside your project directory. The extension will then use readtags to perform symbol definition lookup.

Settings

ctags-companion.command

Default: "ctags -R --fields=+nKz"

Command to generate the tags file. This command is used by the Terminal > Run Task... > Ctags Companion: rebuild tags task.

"ctags-companion.command": "ctags -R --fields=+nKz"

ctags-companion.documentSelector

Default: {"scheme": "file"}

Document selector object used when registering symbol providers, read more at https://code.visualstudio.com/api/references/vscode-api#DocumentSelector.

"ctags-companion.documentSelector": {"scheme": "file"}

ctags-companion.readtagsGoToDefinitionCommand

Default: "readtags -en"

The command used for the "go to definition" feature (i.e. F12 or Ctrl+click).

"ctags-companion.readtagsGoToDefinitionCommand": "readtags -en"

ctags-companion.readtagsGoToSymbolInWorkspaceCommand

Default: "readtags -enpi"

The command used for the "go to symbol in workspace" feature (i.e. Ctrl+T).

"ctags-companion.readtagsGoToSymbolInWorkspaceCommand": "readtags -enpi"

ctags-companion.ctagsGoToSymbolInEditorCommand

Default: "ctags --fields=+nKz -f -"

The command used for the outline and the "go to symbol in editor" feature (i.e. Ctrl+Shift+O).

"ctags-companion.ctagsGoToSymbolInEditorCommand": "ctags --fields=+nKz -f -"

FAQ

How to install Universal Ctags?

  • macOS: brew install universal-ctags
  • Ubuntu: apt install universal-ctags or snap install universal-ctags
  • Windows: winget install 'Universal Ctags'