Saturday, February 19, 2011

Multiple Substitutes for 'includeexpr'

I am trying to use the 'gf' command to open the file containing the Perl module in a "use AB::CD::Module" statement. I included the following line in my .vimrc:
 
set includeexpr=substitute(v:fname,'\\::','/','g')
 
This translates the double colons to slashes in f:fname to form the path name, but I also need to add '.pm' to the end of v:fname. I tried adding a second substitute to the assignment, separated by the vertical bar (|), but this generates an error message while processing .vimrc.
 
How can I apply more than one substitute to v:fname during the assignment to 'includeexpr'?
 
Thanks,
Roy Fulbright
 

No comments: