How to keep the cursorline consistent in vim diff?

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

How to keep the cursorline consistent in vim diff?

DwigtArmyOfChampions
I’m using vimdiff on a three-way diff. I first open Vim using the command “vimdiff file1.txt file2.txt file3.txt”. I have set cursorline enabled and as I arrow down the cursor stays consistent through each of the three windows. But when I do a diffput on one of the buffers the cursorline is no longer consistent. The cursorline on buffer2 is lower than buffer3. How do I update refresh the page?

--
--
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].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to keep the cursorline consistent in vim diff?

Bram Moolenaar

> I’m using vimdiff on a three-way diff. I first open Vim using the
> command “vimdiff file1.txt file2.txt file3.txt”. I have set cursorline
> enabled and as I arrow down the cursor stays consistent through each
> of the three windows. But when I do a diffput on one of the buffers
> the cursorline is no longer consistent. The cursorline on buffer2 is
> lower than buffer3. How do I update refresh the page?

I cannot reproduce the problem.  Please give a step-by-step example.
And what is your Vim version?

--
Time is money.  Especially if you make clocks.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--
--
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].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to keep the cursorline consistent in vim diff?

DwigtArmyOfChampions
On Saturday, March 16, 2019 at 10:20:15 AM UTC-4, Bram Moolenaar wrote:

> I cannot reproduce the problem.  Please give a step-by-step example.
> And what is your Vim version?
>

Vim 8.1. I was able to fix my issue by adding the following to my .vimrc:

" {{{ Vim Diff Options
if &diff

  " Only have to use just the bracket keys to go to the next difference.
  nnoremap ] ]c
  nnoremap [ [c

  " dp will send middle pane changes to right pane and then immediately
  " update.
  nnoremap dp :diffput 3 <bar> :diffupdate<cr>

  " Make sure cursor is always in the middle.
  set scrolloff=999
endif
" }}}

--
--
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].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to keep the cursorline consistent in vim diff?

Paul-7
In reply to this post by DwigtArmyOfChampions
On Fri, Mar 15, 2019 at 09:20:12AM -0700, DwigtArmyOfChampions wrote:
>I’m using vimdiff on a three-way diff. I first open Vim using the command “vimdiff file1.txt file2.txt file3.txt”. I have set cursorline enabled and as I arrow down the cursor stays consistent through each of the three windows. But when I do a diffput on one of the buffers the cursorline is no longer consistent. The cursorline on buffer2 is lower than buffer3. How do I update refresh the page?

I remember having this issue, but I can't remember how I overcame it. Have you eliminated any plugin as the cause?

--
--
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].
For more options, visit https://groups.google.com/d/optout.

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

Re: How to keep the cursorline consistent in vim diff?

DwigtArmyOfChampions
On Thursday, March 21, 2019 at 9:45:21 AM UTC-4, Paul wrote:
> On Fri, Mar 15, 2019 at 09:20:12AM -0700, DwigtArmyOfChampions wrote:
> >I’m using vimdiff on a three-way diff. I first open Vim using the command “vimdiff file1.txt file2.txt file3.txt”. I have set cursorline enabled and as I arrow down the cursor stays consistent through each of the three windows. But when I do a diffput on one of the buffers the cursorline is no longer consistent. The cursorline on buffer2 is lower than buffer3. How do I update refresh the page?
>
> I remember having this issue, but I can't remember how I overcame it. Have you eliminated any plugin as the cause?

It probably was Vim airline, but I'm not skilled enough to know for sure.

--
--
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].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to keep the cursorline consistent in vim diff?

Christian Brabandt

On Do, 21 Mär 2019, DwigtArmyOfChampions wrote:

> It probably was Vim airline, but I'm not skilled enough to know for sure.

I doubt it. vim-airline does only provide a statusline, it doesn't know
about cursorline.


Best,
Christian
--
Ist Weltfrieden ohne religiöse Abrüstung überhaupt möglich?
                -- M.S. Salomon (eigentl. Michael Schmidt-Salomon)

--
--
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].
For more options, visit https://groups.google.com/d/optout.