diff question...

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

diff question...

gregory.sacre
Hi all!

I have a question about the diff commands:
I'd like to diffsplit, but not on a file, on an existing buffer.
I've been through the documentation, but i didn't find the answer.

The usual way to use diffsplit is:
    :diffsplit <filename>.c

What i'd like to know:
Imagine i have 2 buffers in the same vim: file1.c and file1.c.bak. Let
say i'm looking at the code of file1.c and i'd like to know the
differences with file1.c.bak (which is also opened in vim in another
buffer, e.g. buffer 2). Is it possible to do something like:
    :diffsplit buffer 2

Thanks for your help and happy vimming! :-)

Gregory
Reply | Threaded
Open this post in threaded view
|

Re: diff question...

Scott C-2
i think the easiest would be to

:diffsplit #

assuming the one you want to diff with was the last
file you edited before this one



--- Gregory SACRE <[hidden email]> wrote:

> Hi all!
>
> I have a question about the diff commands:
> I'd like to diffsplit, but not on a file, on an
> existing buffer.
> I've been through the documentation, but i didn't
> find the answer.
>
> The usual way to use diffsplit is:
>     :diffsplit <filename>.c
>
> What i'd like to know:
> Imagine i have 2 buffers in the same vim: file1.c
> and file1.c.bak. Let
> say i'm looking at the code of file1.c and i'd like
> to know the
> differences with file1.c.bak (which is also opened
> in vim in another
> buffer, e.g. buffer 2). Is it possible to do
> something like:
>     :diffsplit buffer 2
>
> Thanks for your help and happy vimming! :-)
>
> Gregory
>


__________________________________________________
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: diff question...

Suresh Govindachar`
 Gregory SACRE Sent on 29 Jun 2005 17:55:10 +0200:

> Hi all!
>
> I have a question about the diff commands:
> I'd like to diffsplit, but not on a file, on an existing buffer.
> I've been through the documentation, but i didn't find the answer.
>
> The usual way to use diffsplit is:
>     :diffsplit <filename>.c
>
> What i'd like to know:
> Imagine i have 2 buffers in the same vim: file1.c and file1.c.bak.
> Let say i'm looking at the code of file1.c and i'd like to know
> the differences with file1.c.bak (which is also opened in vim in
> another buffer, e.g. buffer 2). Is it possible to do something
> like:
>     :diffsplit buffer 2
>

Go to each of the buffers you want to diff and issue the
following command
     :diffthis

--Suresh