I can't seem to find the answer to this anywhere.
I'm trying to get started with include-search
, and since I'm working in golang right now, I'm trying to get vim to include a set of imported files.
E.g.
1 import (
2 "foo"
3 _path "bar"
4 "baz"
5 )
I want everything inside double-quotes, between lines 1 and 5. I got as far as the following but it still only matches one line:
/\v^import \((\n\s+"\zs.*\ze")*
:h /\@<=
tells us it's not if you have multiple lines you want to "ignore". I got\(^import (\([^"]*"[^"]\+"\)\{-}\)\@<=[^"]*"\zs[^"]\+\ze"
match each files of your example if they are joined in one line. But even there, settinginclude
to this pattern only finds the first one. @dbenknoble I don't know ifincludeexpr
can import multiple files as it is also used forgf
. Nevertheless, @harv maybe look how/ifvim-go
does it.