https://github.com/c0r73x/neotags.lua
Tag highlight in neovim written in lua
https://github.com/c0r73x/neotags.lua
async ctags highlight lua neotags neovim neovim-plugin
Last synced: 7 months ago
JSON representation
Tag highlight in neovim written in lua
- Host: GitHub
- URL: https://github.com/c0r73x/neotags.lua
- Owner: c0r73x
- License: mit
- Created: 2021-12-17T16:31:45.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-02-15T11:17:49.000Z (over 1 year ago)
- Last Synced: 2024-05-01T15:22:45.555Z (over 1 year ago)
- Topics: async, ctags, highlight, lua, neotags, neovim, neovim-plugin
- Language: Lua
- Homepage:
- Size: 138 KB
- Stars: 21
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# neotags.lua
successor of https://github.com/c0r73x/neotags.nvim

## Default Configuration
```lua
neotags.setup({
enable = true, -- enable neotags.lua
ctags = {
run = true, -- run ctags
directory = vim.env.HOME .. '/.vim_tags' -- default directory where to store tags
verbose = false -- verbose ctags output
binary = 'ctags', -- ctags binary
args = { -- ctags arguments
'--fields=+l',
'--c-kinds=+p',
'--c++-kinds=+p',
'--sort=no',
'-a'
},
},
ft_conv = { -- ctags filetypes to vim filetype
['c++'] = 'cpp',
['moonscript'] = 'moon',
['c#'] = 'cs'
},
ft_map = { -- combine tags from multiple languages (for example header files in c/cpp)
cpp = { 'cpp', 'c' },
c = { 'c', 'cpp' }
},
hl = {
minlen = 3, -- dont include tags shorter than this
patternlength = 2048, -- max syntax length when splitting it into chunks
prefix = [[\C\<]], -- default syntax prefix
suffix = [[\>]] -- default syntax suffix
},
tools = {
find = nil, -- tool to find files (defaults to running ctags with -R)
-- find = { -- example using fd
-- binary = 'fd',
-- args = { '-t', 'f', '-H', '--full-path' },
-- },
},
ignore = { -- filetypes to ignore
'cfg',
'conf',
'help',
'mail',
'markdown',
'nerdtree',
'nofile',
'readdir',
'qf',
'text',
'plaintext'
},
notin = { -- where not to include highlights
'.*String.*',
'.*Comment.*',
'cIncluded',
'cCppOut2',
'cCppInElse2',
'cCppOutIf2',
'pythonDocTest',
'pythonDocTest2'
}
})
```## Add new language
`neotags.language('filetype', require'path/to/filetype')`
### Filetype config
example using C language
```lua
return {
order = 'guesmfdtv', -- string with ctags kinds
kinds = {
g = {
group = 'neotags_EnumTypeTag', -- highlight
prefix = [[\%(enum\s\+\)\@5<=]] -- override default prefix
minlen = 2, -- dont include tags shorter than this
},
...
t = {
group = 'neotags_TypeTag',
suffix = [[\>\%(\.\|->\)\@!]] -- override default suffix
},
v = {
group = 'neotags_GlobalVarTag'
}
}
}
```## Toggle neotags
`neotags.toggle()`