Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vim-gutentags doesn't work when use with gtags-cscope. #28

Closed
LimbicSys opened this issue Jan 20, 2024 · 1 comment
Closed

Vim-gutentags doesn't work when use with gtags-cscope. #28

LimbicSys opened this issue Jan 20, 2024 · 1 comment
Assignees

Comments

@LimbicSys
Copy link

Describe the bug

use({
	"dhananjaylatkar/vim-gutentags",
	after = "cscope_maps.nvim",
	config = function()
		vim.g.gutentags_modules = {"cscope_maps"} -- This is required. Other config is optional
		vim.g.gutentags_cscope_build_inverted_index_maps = 1
		vim.g.gutentags_cache_dir = vim.fn.expand("~/code/.gutentags")
		vim.g.gutentags_file_list_command = "fd -e c -e h"
		-- vim.g.gutentags_trace = 1
	end,
})

The setting doesn't work with gtags-cscope.
ludovicchabant/vim-gutentags#346 The PR only added support for cscope.
I guess something like autoload/gutentags/gtags_cscope.vim is needed.

nvim version (please complete the following information):
NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1703358377

system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.9.5/share/nvim"

Run :checkhealth for more info

cscope_maps config (please complete the following information):

opts = {
      cscope = {
        exec = "gtags-cscope",
      },
}
@dhananjaylatkar
Copy link
Owner

Alternative to gutentags is, rebuild DB using :Cscope build or <prefix>cb.

You can also create autocmd for running :Cscope build after saving .c and .h files.
e.g

local group = vim.api.nvim_create_augroup("CscopeBuild", { clear = true })
vim.api.nvim_create_autocmd("BufWritePost", {
  pattern = { "*.c", "*.h" },
  callback = function ()
    vim.cmd("Cscope build")
  end,
  group = group,
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants