vimdiff tutorial?

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

vimdiff tutorial?

estebahn fallhallah
Hi there,

I'm new to using vimdiff and I haven't found a nice tutorial on it.  I looked into the `:help` area, but I don't really understand how that applies to the single task at hand (a pretty frustrating merge conflict in the repo I'm working in).  I guess I wouldn't mind if someone told me to RTFM, but I also would love a link to more of a hand-holding primer on what the tool does in the context of a GIT merge conflict, along with how to get yourself past the conflict quickly.  For example this page (http://amjith.blogspot.com/2008/08/quick-and-dirty-vimdiff-tutorial.html) does not seem to clarify that much for me, as something like "do" doesn't apply in the default view (4 buffers) - I mean, which would be the "other" window in that case?  Etc.

Thanks for any help...  
jml

--
--
You received this message from the "vim_mac" 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_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: vimdiff tutorial?

David Henderson

On 21 Nov 2014, at 13:03, jml <[hidden email]> wrote:

> Hi there,
>
> I'm new to using vimdiff and I haven't found a nice tutorial on it.  I looked into the `:help` area, but I don't really understand how that applies to the single task at hand (a pretty frustrating merge conflict in the repo I'm working in).  I guess I wouldn't mind if someone told me to RTFM, but I also would love a link to more of a hand-holding primer on what the tool does in the context of a GIT merge conflict, along with how to get yourself past the conflict quickly.  For example this page (http://amjith.blogspot.com/2008/08/quick-and-dirty-vimdiff-tutorial.html) does not seem to clarify that much for me, as something like "do" doesn't apply in the default view (4 buffers) - I mean, which would be the "other" window in that case?  Etc.

How familiar are you with editing in vim? vimdiff file1 file2 is nothing more than shorthand for vim -d file1 file2. One can also achieve the same just by vertically splitting a window and loading different buffers in each window and then running command :diffthis on each window. The other window would be the one not being actively edited. ‘do’ is a normal mode operation which is equivalent to the command mode :diffget which just means make the current buffer (the one being actively edited) line the same as the other buffer. ‘dp’ and :diffput are the operations for making the non-active buffer line the same as the current buffer line. Hope this helps to clarify.

David P Henderson
--
"Criticizing evolutionary theory because Darwin was limited is like claiming computers don't work because Chuck Babbage didn't foresee Duke Nukem 3."
   -- Patrick Coskren

--
--
You received this message from the "vim_mac" 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_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: vimdiff tutorial?

estebahn fallhallah
> How familiar are you with editing in vim? vimdiff file1 file2 is nothing more than shorthand for vim -d file1 file2. One can also achieve the same just by vertically splitting a window and loading different buffers in each window and then running command :diffthis on each window.
> The other window would be the one not being actively edited. ‘do’ is a normal mode operation which is equivalent to the command mode :diffget which just means make the current buffer (the one being actively edited) line the same as the other buffer. ‘dp’ and :diffput are the operations for making the non-active buffer line the same as the current buffer line. Hope this helps to clarify.

Thanks for these clarifications.
I still don’t understand what ‘do’ “other buffer” means in the context of more than 2 buffers, but I will look into it.
I found out about diffget today, and ‘[c’, ‘]c’.  I also learned a bit about how VIM syntax colorizes the various areas to represent conflicts vs differences, and how to navigate quickly through a diff in order to assess changes.  In a larger file this still seems tricky to me, but I probably just need to get used to the flow.

Thanks much,
jml

--
--
You received this message from the "vim_mac" 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_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: vimdiff tutorial?

David Henderson

On 21 Nov 2014, at 18:12, Estebahn Falhallah <[hidden email]> wrote:

> I still don’t understand what ‘do’ “other buffer” means in the context of more than 2 buffers, but I will look into it.
> I found out about diffget today, and ‘[c’, ‘]c’.  I also learned a bit about how VIM syntax colorizes the various areas to represent conflicts vs differences, and how to navigate quickly through a diff in order to assess changes.  In a larger file this still seems tricky to me, but I probably just need to get used to the flow.
>

You won’t be able to use normal mode operations with working with more than 2 windows; you’ll have to use the command mode :diff* operations and you’ll have to specify which buffer is the other window using 1) the buffer number, 2) a pattern for the buffer name, or 3) enough of the buffer name to make it clear to which buffer you are referring.

David P Henderson
--
"The things that will destroy America are prosperity at any price, peace at any price, safety first instead of duty first and love of soft living and the get-rich-quick theory of life."
    -- Theodore Roosevelt

--
--
You received this message from the "vim_mac" 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_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: vimdiff tutorial?

Lucas Burke
In reply to this post by estebahn fallhallah
On Friday, November 21, 2014 4:03:26 PM UTC-5, jml wrote:

> I guess I wouldn't mind if someone told me to RTFM, but I also would love a link to more of a hand-holding primer on what the tool does in the context of a GIT merge conflict, along with how to get yourself past the conflict quickly.

Hi,

There are some excellent screencasts on using the fugitive plugin in vim with git at [Drew Neil’s vimcasts.org site](http://vimcasts.org/categories/git/). He gives a good overview particularly of how to work with the diff commands in vim to carry out git tasks. Watching them was how I got started. Hope that helps!

Best,
Lucas.

--
--
You received this message from the "vim_mac" 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_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: vimdiff tutorial?

estebahn fallhallah

Thanks so much!  I appreciate it.

On Nov 24, 2014 7:21 AM, "Lucas Burke" <[hidden email]> wrote:
On Friday, November 21, 2014 4:03:26 PM UTC-5, jml wrote:

> I guess I wouldn't mind if someone told me to RTFM, but I also would love a link to more of a hand-holding primer on what the tool does in the context of a GIT merge conflict, along with how to get yourself past the conflict quickly.

Hi,

There are some excellent screencasts on using the fugitive plugin in vim with git at [Drew Neil’s vimcasts.org site](http://vimcasts.org/categories/git/). He gives a good overview particularly of how to work with the diff commands in vim to carry out git tasks. Watching them was how I got started. Hope that helps!

Best,
Lucas.

--
--
You received this message from the "vim_mac" 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 a topic in the Google Groups "vim_mac" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_mac/2Pm0kVVUjx0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
--
You received this message from the "vim_mac" 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_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.