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

Can't save tags file in .git subdirectory

Open aktau opened this issue 11 years ago • 2 comments
trafficstars

I've been scratching my head about this for quite a while, as I think it's a good idea to keep the tags file in the .git subdirectory when it exists.

It appears this manifests itself in the xolox#misc#option#eval_tags function. There, expand() is used on every piece of &tags. However, every filename that matches something in &wildignore gets... ignored. I'm not sure it's supposed to be the case that this happens. But what would be a suggested workaround for this?

So, what I would like:

  • when a project is a git project, save the tags file in .git/tags (normally vim fugitive takes care of setting this as the first path in &tags
  • when a project is not a git project, save the tags file in the global tags file (could be ~/.vimtags)

How would I be able to do this?

Thanks!

aktau avatar Feb 27 '14 16:02 aktau

By the way, I've succesfully tested replacing:

# call extend(pathnames, split(expand(pattern), "\n"))
call extend(pathnames, split(expand(pattern, 1), "\n"))

This is the {nosuf} argument which makes vim &wildignore...

aktau avatar Feb 27 '14 16:02 aktau

Here is my settings

let g:easytags_dynamic_files = 2
let gitroot = system("git rev-parse --show-superproject-working-tree --show-toplevel | head -n1 | tr -d '\\n'")
autocmd BufReadPre,FileReadPre * execute !empty(gitroot) ? 'setl tags=' . gitroot . "/.git/vimtags" : 'setl tags=~/.vimtags'

jcppkkk avatar Jun 18 '19 07:06 jcppkkk