Changing the scope of 'diff' to something more granular?

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

Changing the scope of 'diff' to something more granular?

Tim Chase
I have a couple files that changed and can diff any pair of them with

  $ vim old-a.txt new-a.txt

which works as expected.  However, if I try to diff old-a/new-a and
also try to :diffsplit old-b/new-b, it compares *all* of those files.
Which is also expected.  So currently I need to launch each diff in
its own session of vim.

  shell1$ vim old-a.txt new-a.txt
...
  shell2$ vim old-b.txt new-b.txt

While this is functional (and less bad within a tmux session), is it
possible to narrow the scope of a :vimdiff to a vim-tab so that I can
have a single vim session with multiple file-diff pairs within?

Mostly it's nice to have things like `gd`, `gD`, jump to places that
show the diffs in the destination as well.

Thanks for any ideas,

-tim



--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200424160948.3af20ea3%40bigbox.attlocal.net.
Reply | Threaded
Open this post in threaded view
|

Re: Changing the scope of 'diff' to something more granular?

Paul-7
On Fri, Apr 24, 2020 at 04:09:48PM -0500, Tim Chase wrote:
>While this is functional (and less bad within a tmux session), is it
>possible to narrow the scope of a :vimdiff to a vim-tab so that I can
>have a single vim session with multiple file-diff pairs within?

Unless I'm misunderstanding, why don't you open the new diff pair in a new tab?

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200425140812.GA10298%40rainslide.net.

signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Changing the scope of 'diff' to something more granular?

Tim Chase
On 2020-04-25 15:08, Paul wrote:
> On Fri, Apr 24, 2020 at 04:09:48PM -0500, Tim Chase wrote:
> >While this is functional (and less bad within a tmux session), is
> >it possible to narrow the scope of a :vimdiff to a vim-tab so that
> >I can have a single vim session with multiple file-diff pairs
> >within?  
>
> Unless I'm misunderstanding, why don't you open the new diff pair
> in a new tab?

Well dang.  That does work.  I misread/misunderstood the text at

  :help 'diff'

which says that the setting is "local to window".  In my
(mis-conceived) tests, opening a new vim window (:sp) from a diff'ed
window resulted in a windo that had 'diff' set, leading me to
(mis-)understand "window" as a vim-session not a vim-window.  Had I
properly tested, I would have noticed that after a ":sp" on a diffed
window, I could then

  :set nodiff

on one of those and it was in fact scoped to a vim-window not a
vim-session.

Reading up at ":help start-vimdiff" it does indeed say that "Diffs
are local to the current tab page" which is exactly what I wanted
and just failed to find/understand.

Thanks for setting me straight!

-tim




--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200425094128.5a09da0c%40bigbox.attlocal.net.