Ben Fritz wrote:
>
> On Apr 29, 1:50 pm, cablesimple <[email protected]>
> wrote:
>
>> Hi,
>> I use gVim on Windows for writing PHP code. I just got a new PC and
>> setup gVim again and for some reason :make isn't working correctly
>> anymore. The compile string that it uses is:
>> C:\WINDOWS\system32\cmd.exe /c php -lq >C:
>> \DOCUME~1\CROBIN~1\LOCALS~1\Temp\VIe2
>> 6C.tmp 2>&1
>>
>> Which would be just fine except for the ">" right before the temp file
>> path. When I manually remove that and try the command in a DOS window
>> it works just fine, however with the ">" it just hangs forever.
>>
>> Where can I adjust that path? Where is it generated from?
>>
>>
>
> This looks like the 'shellpipe' option. Most compilers redirect to
> stdout and/or stderr, apparently this one does not.
>
> According to :help 'shellpipe', setting 'shellpipe' to an empty string
> will make it not redirect the output, however with experimentation it
> seems that it will also not append the temp file name, so you need to
> set it to %s instead.
>
> For now, (assuming you use ":compiler php" to set up your make
> environment) you could get by with copying $VIMRUNTIME/compiler/
> php.vim into $HOME/.vim/compiler/php.vim and adding this line:
>
> CompilerSet shellpipe=%s
>
>
>> Also, on my old machine I didn't have to set the compiler to PHP, it
>> knew by filetype. How would I accomplish that again?
>>
>>
>
> This one is pretty easy:
>
> autocmd FileType php compiler php
>
> If you're doing it this way, you can ignore my advice about copying
> and editing the compiler file and just do:
>
> autocmd FileType php compiler php | setlocal shellpipe=%s
> >
>
>
Thank you very much for the response Ben. After playing with the
shellpipe option a bit I realized that I was actually reporting my
problem incorrectly. In the string:
C:\WINDOWS\system32\cmd.exe /c php -lq
>C:\DOCUME~1\CROBIN~1\LOCALS~1\Temp\VIe26C.tmp 2>&1
It isn't putting the ">" in where it doesn't belong...it's missing the actual
source code file after the "php -lq" part.
Where does that get configured? This is the compiler script I'm using:
if exists("current_compiler")
finish
endif
let current_compiler = "php"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo-=C
CompilerSet makeprg=php\ -lq
CompilerSet errorformat=%E<b>Parse\ error</b>:\ %m\ in\ <b>%f</b>\ on\ line\
<b>%l</b><br\ />,
\%W<b>Notice</b>:\ %m\ in\ <b>%f</b>\ on\ line\
<b>%l</b><br\ />,
\%EParse\ error:\ %m\ in\ %f\ on\ line\ %l,
\%WNotice:\ %m\ in\ %f</b>\ on\ line\ %l,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---