I have tested it and it works without any hitch on my system.

(WinXp SP2 with Cygwin)

Regards,
Sibin

-----Original Message-----
From: A.J.Mechelynck [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 06, 2006 12:55 PM
To: Sibin P. Thomas
Cc: Yegappan Lakshmanan; vim@vim.org
Subject: Re: quick and dirty compile

Sibin P. Thomas wrote:
> Thank a lot to everyone!
> I added the following to my _vimrc file to get what I wanted
> 
> nmap <C-F9> :Makecompile<CR>
> nmap <F5> :Makexec<CR> :!%<.exe<CR>
> command Makecompile :se makeprg=gcc\ -o\ %<.o\ % | :make!
> command Makexec :se makeprg=gcc\ -o\ %<\ % | :make!
> 
> Regards,
> Sibin


We're not within a makefile: I don't believe %< will be interpreted. 
Passing %<.o (with % interpreted by Vim) to the shell would mean "the 
current file, and read stdio from a file named .o". Use %:r.o or, if it 
doesn't work,

        command Makexec -nargs=0 -bar
                \ exe 'set makeprg=gcc\ -o\ '
                \ . fnamemodify(expand('%'),':p:r')
                \ . '.o\ '
                \ . expand('%')
                \ | make!

with single quotes to avoid interpretation of backslashes before the 
":set" command.

See ":help filename-modifiers"


Best regards,
Tony.
-----------------------------------------------------------------------------------------------------------------------------
Disclaimer
-----------------------------------------------------------------------------------------------------------------------------

"This message(including attachment if any)is confidential and may be 
privileged.Before opening attachments please check them
for viruses and defects.MindTree Consulting Private Limited (MindTree)will not 
be responsible for any viruses or defects or
any forwarded attachments emanating either from within MindTree or outside.If 
you have received this message by mistake please notify the sender by return  
e-mail and delete this message from your system. Any unauthorized use or 
dissemination of this message in whole or in part is strictly prohibited.  
Please note that e-mails are susceptible to change and MindTree shall not be 
liable for any improper, untimely or incomplete transmission."

-----------------------------------------------------------------------------------------------------------------------------

Reply via email to