vim-tags icon indicating copy to clipboard operation
vim-tags copied to clipboard

Empty tags file under .git

Open lanespade opened this issue 10 years ago • 9 comments

OS: RHEL5 Vim: 7.4 (compiled locally) Ctags: 5.6

Running "ctags -R ." creates the tag file successfully, however whenever I run ":TagsGenerate!" inside Vim, an empty tags file is placed under .git. I saw the other issue where the .gitignore file had entries that began with "!" were affecting the file generation, but it seems to have been fixed and none of my .gitignore entries have ! anywhere in them. Any ideas are greatly appreciated!

lanespade avatar Sep 18 '14 22:09 lanespade

I have similar issue with empty file. I've traced it down and realised that it is due to backgrounding of file generation:

    exe '!' . command '&'

That ampersand... It doesn't work with MacVim but works with console version. It makes think that it is due to shell specifics. I am using zsh (and in vim as well).

bogdan avatar Aug 12 '15 15:08 bogdan

This has struck me also.

Environment: OS/X Shell: zsh vim: 7.4.873 running under tmux vim-dispatch installed and used.

rojspencer avatar Oct 14 '15 14:10 rojspencer

Disabling use of vim-dispatch has allowed a tags file to be generated.

let g:vim_tags_use_vim_dispatch = 0

rojspencer avatar Oct 14 '15 14:10 rojspencer

I also noticed an empty tags file in some of my projects that are managed by git. I often have the lines

.*
!.gitignore

in my .gitignore files. After removing .* the tags generation with

:TagsGenerate!

works fine. Any ideas?

IngoMeyer441 avatar Feb 18 '16 07:02 IngoMeyer441

This happened to me when i had "ctags" in the gitignore file

simonwahlgren avatar Dec 06 '16 13:12 simonwahlgren

same problem, any solutions here?

axot avatar Jan 19 '17 04:01 axot

@axot I solved it by disabling vim-tags builtin ignore-file method like this: let g:vim_tags_ignore_files = []. I instead ignore stuff in my ~/.ctags config, eg:

--recurse=yes
--exclude=.git
--exclude=.venv
--languages=python
--kinds-Python=-Ivixzl
--tag-relative=yes

simonwahlgren avatar Jan 19 '17 08:01 simonwahlgren

@simonwahlgren after setting vim_tags_ignore_files, it works! Thank you.

axot avatar Jan 19 '17 08:01 axot

In my case the tags file is correctly built but it is placed in the .git folder, instead of the root folder (therefore the folder containing the .git folder). Any explanation?

This is my vim-tags related section in my .vimrc:

let g:vim_tags_use_vim_dispatch = 1
let g:vim_tags_auto_generate = 0
let g:vim_tags_directories = [".git"]
let g:vim_tags_ignore_files = ['.gitignore', '.svnignore', '.cvsignore']
let g:vim_tags_use_language_field = 1
set tags=tags;

albasili avatar Feb 07 '18 08:02 albasili