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


-----Original Message-----
From: Yegappan Lakshmanan [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 06, 2006 10:56 AM
To: Sibin P. Thomas
Cc: vim@vim.org
Subject: Re: quick and dirty compile

Hi,

On 9/5/06, Sibin P. Thomas <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Could someone let me know how to quickly compile my current buffer? I want
a
> key map like
> nmap <F5> "xxxxx" to do --> gcc -o current_file.o current_file.c
>

Try using the following command:

      nnoremap <F5> :!gcc -o %:p:r.o %<CR>

>
> also another map to make an executable, like
> nmap <F5> "xxxxx" to do --> gcc -o current_file current_file.c
>

Try using the following command:

       nnoremap <F5> :!gcc -o %:p:r %<CR>

>
> Also it would be convenient if this command could give a list of errors
like
> :make.
>

To use make and jump to compile-time errors, try the following command:

    set makeprg=gcc\ -o\ %<\ %

- Yegappan
-----------------------------------------------------------------------------------------------------------------------------
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