https://github.com/orbitalquark/textadept-ctags
Utilize Ctags with Textadept.
https://github.com/orbitalquark/textadept-ctags
ctags textadept textadept-module
Last synced: 7 months ago
JSON representation
Utilize Ctags with Textadept.
- Host: GitHub
- URL: https://github.com/orbitalquark/textadept-ctags
- Owner: orbitalquark
- License: mit
- Created: 2020-10-07T22:46:20.000Z (almost 5 years ago)
- Default Branch: default
- Last Pushed: 2023-02-13T14:25:57.000Z (over 2 years ago)
- Last Synced: 2025-01-11T11:12:32.980Z (9 months ago)
- Topics: ctags, textadept, textadept-module
- Language: Lua
- Homepage:
- Size: 74.2 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ctags
Utilize Ctags with Textadept.
Install this module by copying it into your *~/.textadept/modules/* directory or Textadept's
*modules/* directory, and then putting the following in your *~/.textadept/init.lua*:require('ctags')
There will be a "Search > Ctags" menu.
There are four ways to tell Textadept about *tags* files:
1. Place a *tags* file in a project's root directory. This file will be used in a tag
search from any of that project's source files.
2. Add a *tags* file or list of *tags* files to the [`ctags`](#ctags) module for a project root key.
This file(s) will be used in a tag search from any of that project's source files. For
example: `ctags['/path/to/project'] = '/path/to/tags'`.
3. Add a *tags* file to the [`ctags`](#ctags) module. This file will be used in any tag search. For
example: `ctags[#ctags + 1] = '/path/to/tags'`.
4. As a last resort, if no *tags* files were found, or if there is no match for a given
symbol, a temporary *tags* file is generated for the current file and used.Textadept will use any and all *tags* files based on the above rules.
## Generating Ctags
This module can also help generate Ctags files that can be read by Textadept. This is
typically configured per-project. For example, a C project might want to generate tags for
all files and subdirectories in a *src/* directory:ctags.ctags_flags['/path/to/project'] = '-R src/'
A Lua project has a couple of options for generating tags:
-- Use ctags with some custom flags for improved Lua parsing.
ctags.ctags_flags['/path/to/project'] = ctags.LUA_FLAGSThen, invoking Search > Ctags > Generate Project Tags menu item will generate the tags file.
## Key Bindings
Windows and Linux | macOS | Terminal | Command
-|-|-|-
**Search**| | |
F12 | F12 | F12 | Go to Ctag
Shift+F12 | ⇧F12 | S-F12 | Go to Ctag...## Fields defined by `ctags`
A set of command-line options for ctags that better parses Lua code.
Combine this with other flags in [`ctags.ctags_flags`](#ctags.ctags_flags) if Lua files will be parsed.Path to the ctags executable.
The default value is `'ctags'`.## Functions defined by `ctags`
### `_G.textadept.editing.autocompleters.ctag`()Autocompleter function for ctags. (Names only; not context-sensitive).
Does not remove duplicates.Jumps to the source of string *tag* or the source of the word under the caret.
Prompts the user when multiple sources are found.Parameters:
- *tag*: The tag to go to the source of.
Return:
- whether or not a tag was found and jumped to.
## Tables defined by `ctags`
Map of project root paths to string command-line options, or functions that return such
strings, that are passed to ctags when generating project tags.---