I am somewhat fond of Vim's include and definition search
and would like to spread their use to non-C-like languages,
but I find the identification by prefix patterns too limiting for
some of the languages I use. Perhaps someone here can help?
For 'define', I can work around the limitiations of prefix
matching because include file search itself is exposed as
a command, so I can build my own scripts.
For 'include', I haven't been able to find a workaround:
is there any way to add include files by Vim script?
Two examples of the kind of problems I'd like to solve
can be illustrated with Javascript projects:
(a) there are implicit include files, which I'd like to add
(e.g., if multiple .js files are included from some
index.html file, I'd like to "include" the index.html from
every .js file, so that the include from the HTML
allows discovery of the other relevant .js files)
(b) module import constructs are too complex to
extract individual imports by prefix match only
(instead, I'd like to identify the module construct,
and extract a list of include files by script)
One sufficient solution to (a) would be if I could use
"\zs\%1l\ze" in 'include', to get a single guaranteed
match in the file, and 'includeexpr', to convert the
contents of the match into 'index.html'. By my reading
of the docs that should be possible, but I can't get it
to work.
One sufficient solution to (b) would be if 'includeexpr'
could optionally return a list of include files.
Any suggestions?
Claus
--
You received this message from the "vim_use" 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