How can I make the following work?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I make the following work?

John Doe-4
:map <F7> :cd %:p:h | make -f% <CR><CR>

I don't want to run make after mapping but have it as
part of the command.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
Reply | Threaded
Open this post in threaded view
|

Re: How can I make the following work?

A.J.Mechelynck
----- Original Message -----
From: "John Doe" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, July 26, 2005 3:51 AM
Subject: How can I make the following work?


> :map <F7> :cd %:p:h | make -f% <CR><CR>
>
> I don't want to run make after mapping but have it as
> part of the command.

Try
    :map <F7> :cd %:p:h <Bar> make -f% <CR><CR>

See
    :help <Bar>
    :help map-bar

HTH,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: How can I make the following work?

John Doe-4
Oh, it always makes my day when I learn a new vim
hack. I've also tried to use:

:map <F7> :cd %:p:h \| make -f% <CR><CR>

and it also works. Thanks for the help.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com