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

Question: can tagbar use same ctags file as gutentags? #872

Open
lijh8 opened this issue Feb 25, 2024 · 1 comment
Open

Question: can tagbar use same ctags file as gutentags? #872

lijh8 opened this issue Feb 25, 2024 · 1 comment

Comments

@lijh8
Copy link

lijh8 commented Feb 25, 2024

Hi, currently, both tagbar and gutentags work on my computer.
gutentags will generate tags file in the same directory with .git,
will tagbar use this tags file too?

Thanks


$ tree -a

.
└── src
    ├── .git
    ├── main
    │   ├── Makefile
    │   ├── foo.cpp
    │   ├── foo.h
    │   └── main.cpp
    └── tags

$
$ ls src/.git
$ ls src/tags
src/tags
$

$ cat ~/.vimrc

"" Tagbar
" https://github.com/preservim/tagbar/issues/851
autocmd QuitPre * qall
autocmd VimEnter * Tagbar
let g:tagbar_sort = 0
nnoremap <F8> :TagbarToggle<CR>

"" gutentags: ctags: Ctrl-], Ctrl-t
" $ mkdir ~/project_root_dir/.git
let g:gutentags_add_default_project_roots = 1

$

@raven42
Copy link
Collaborator

raven42 commented Feb 26, 2024

Based on the current tagbar implementation, no it will not use any pre-generated tagfiles. The current behavior of tagbar is it will generate a tagfile for the open buffer in a temporary file to read the contents from that. So you don't need any existing tag files or anything. This has the benefit of being able to update the tags from the file every time it is written as well, so it isn't reliant on another process to generate new tag files.

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