A. Pagaltzis writes:

> * Smylers <[EMAIL PROTECTED]> [2005-12-04 03:35]:
> 
> > That's because the default ftplugin/perl.vim sets iskeyword to
> > include the colon, so that all gets treated as a single word.
> > Until now I hadn't seen a disadvantage of removing that colon,
> > but now you've pointed that out I'm going to have to choose
> > between putting up with that bug in syntax highlighting or
> > making namespaces more awkward to complete ...
> 
> Another disadvantage, and a reason I could never live without
> that colon: move the cursor on top of a module name, then hit
> [Ctrl-W][f] or [g][f].

That's the colon in isfname (which I do have), rather than the one in
iskeyword (which I don't, but perhaps I should).

> Neat, no?

Indeed (though there's an irritating bug where if I have something like
~/lib/perl/ early in my path and CGI::Lite is installed there then when
Perl searches for CGI will find the _directory_ ~/lib/perl/CGI/
(necessary for CGI::Lite), rather than CGI.pm (which is later in the
path).  There's some magic which says "also check for this filename with
'.pm' on the end", but we really want that to be "only" rather than
"also".

The last time I looked at that I couldn't see a way of fixing it.

> It could be smarter yet (it only works relative to @INC or the current
> directory; hmm, now that I think about it I may have an idea for to
> fix that?)

I have this in ~/.vim/after/ftplugin/perl.vim:

  let &l:path = system('perl -I, -Ilib -I../lib -e "print join q[,], @INC"')

That adds in ./lib/ and ../lib/.  But it'd be good to look for use lib
statements and similar in the code and add those in too.

Smylers
-- 
May God bless us with enough foolishness to believe that we can make a
difference in this world, so that we can do what others claim cannot be done.

Reply via email to