szw / vim-tags

Ctags generator for Vim

Home Page:http://www.vim.org/scripts/script.php?script_id=4377

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exclamation marks in .gitignore file prevent generation of tags file

mpfusion opened this issue · comments

Steps to reproduce

  1. Take a git repostitory
  2. Create .gitignore with e.g. the following content:
/doc/*
!/doc/Doxyfile
  1. Create empty file: .git/tags

When saved, the file .git/tags is still empty. If the line !/doc/Doxyfile is removed from .gitignore, the tags file is sucessfully generated.

So far I cannot reproduce it on OSX, though I'm investigating it further.

As a quick workaround you may try:
let g:vim_tags_ignore_file_comment_pattern = '^[#"!]'

Update:
Ok, I see that behavior with zsh. Perhaps ! is expanded by the shell.

Update 2:
Well, finally I can confirm it performs strange in bash too. Interesting, it works well with vim-dispatch. Anyways, I'm going to cut off lines starting with a bang in ingnore files. To add them to the ctags exclude list doesn't make any sense, since exclamation mark has exactly the opposite meaning. Right now I don't have a better idea how to handle such negated patterns with ctags.

Ha, the better idea was to try to append ctags for negated files to the main tags file. Hope, it solves this issue and introduces a new feature as well :).

Thanks for reporting this @mpfusion :)

It works now. Thanks for the quick fix.