I'm trying to find a way to expand the paths vim uses when you call gf, specifically to include paths from "use lib" statements or other such modifications to @INC within the given Perl source. I have a fairly heavy-handed mechanism for doing this by invoking perl-vimscript but feel like there is likely an easier way that incorporates with the existing gf mechanism.Thanks in advance for your help!
Thanks for the response, Ben. I'll see what I can do with that and post my results here.
my @use_lines = grep(m/use lib /, $self->curwin->Buffer->Get(1 .. $self->curwin->Buffer->Count()));
for my $use_line(@use_lines) { if($use_line =~ m/FindBin/) { # Replace FindBin::? with appropriate overrides from the VIM API. my $current_file = VIM::Eval('expand("%:p:h")'); $use_line =~ s{\$FindBin::Bin}{$current_file}g; $use_line =~ s{\$FindBin::RealBin}{$current_file}g; } try { VIM::Msg("modified use_line: $use_line") if($self->debug); eval($use_line); } catch { # Do nothing as this was un-eval-able };}