Files
gentags.nvim/README.md
2023-12-29 10:07:05 +08:00

5.2 KiB

gentags.nvim

Neovim commons.nvim luarocks ci.yml codecov

Tags generator/management for old school vimers in Neovim.

To be honest, it seems that tags have become useless in Neovim today, LSP and treesitter replaced tags and make (Neo)vim a more modern editor.

While there exists gap when LSP server or treesitter implementations are insufficient, which brings tags back to us as a supplement to fill the gap.

Table of Contents

Features

  • Automatically generate tags for both workspace/single file.
  • Running in background & terminate immediately on nvim leave.
  • Incremental update on file save.
  • Disk cache management and garbage collection.
  • Real-time status for Neovim components such as statusline.

Requirements

PRs are welcome to add other backends.

Install

With lazy.nvim
require("lazy").setup({
  {
    "linrongbin16/gentags.nvim",
    config = function()
      require('gentags').setup()
    end,
  },
})
With pckr.nvim
require("pckr").add({
  {
    "linrongbin16/gentags.nvim",
    config = function()
      require("gentags").setup()
    end,
  },
})

Usage

Gentags will register several background jobs when you editing files:

  • Locate the workspace root directory, or fallback to single file mode.
  • Generate and load tags on first file open.
  • Update tags on file save.
  • Terminate background jobs on nvim leave.

By default all tags are generated in stdpath('cache') . '/gentags.nvim' directory:

  • For UNIX/Linux: ~/.cache/nvim/gentags.nvim.
  • For Windows: $env:USERPROFILE\AppData\Local\Temp\nvim\gentags.nvim.

Configuration

To configure default options, please use:

require('gentags').setup(opts)

The otps is an optional lua table that overwrites default options.

For complete options and defaults, please see configs.lua.

Recommendations

Recommend use tags with below plugins to smooth your editing flow:

Alternatives

Development

To develop the project and make PR, please setup with:

To run unit tests, please install below dependencies:

Then test with vusted ./test.

Contribute

Please open issue/PR for anything about gentags.nvim.

Like gentags.nvim? Consider

Github Sponsor Wechat Pay Alipay