I am re-posting this to vim-dev, since it got zero responses on vim-use,
which seems like more of a "basic usage"-oriented group anyway.
I have a simple goal:
Configure *ins-completion* and *:tag* such that, if I want, *only* tags in
the current file and included files will be considered.
For example, suppose I am working in a giant legacy Python codebase that's
tens of thousands of lines long, where the "User" class is defined 20 times.
I have "from common.model import User" at the top of my file.
If I run :tag User, or even :ts User, vim should ONLY consider the one tag
defined in the common.model package. (For a bonus, it would be nice to be
able to drive this with a dependency injection framework.)
One way of doing this would be creating a tag file for every single file,
and having an :autocommand that sets the 'tag' option every time I enter a
buffer. But I really, really, *really* don't want to litter my codebase
with tag files, and I feel like this would be a fragile, potentially slow
solution.
I would love to do this by somehow "filtering" the tags in my global tag
file (created with ctags -R --lang=python), but I haven't found a way to do
it yet.
I'm aware that ^x^o ('omnifunc') can do this for completion; Aaron Griffin's
pythoncomplete.vim is pretty great at it, though it's mainly strongest with
builtins. But I feel like there's some kind of duplication of effort here.
^x^] (compl-tag) is SO close to doing it right--if only it could filter
tags based on 'include' and 'includeexpr'!
Is this a solved problem?
Thanks!
- Max
Gtalk: [email protected]
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php