Loading ...
Sorry, an error occurred while loading the content.
 

Re: vimdiff optimisation

Expand Messages
  • Tim Chase
    ... While I don t have an answer for this, as sometimes vim seems to track cursor location, and sometimes it doesn t. But yes, this would be useful to know
    Message 1 of 4 , Oct 1, 2007
      > 1) Is there any way to do to cursor position what scrollbind
      > does to scroll position? I want to jump to the 'same' line
      > every time I switch focus.

      While I don't have an answer for this, as sometimes vim seems to
      track cursor location, and sometimes it doesn't. But yes, this
      would be useful to know how to do.

      > 2) Is there any way to tell vim 'take this line[s] and
      > overwrite the according line[s] in the other buffer' other
      > than yy^w<scroll>Pdd? I would be happy to script this if I had
      > a reliable way to go to the line on the same heigth in the
      > other buffer, so this is highly related to 1)


      You might be interested in the

      :diffput
      :diffget

      pair of commands. I find diffput more useful because if the line
      is missing in the file, you can't move the cursor there to do a
      diffget, so you have to move to the cursor to the other file and
      do a diffput instead. There are also "do" and "dp" commands in
      normal mode to do this. It does push around the entire
      change-block that you're in, rather than just the current line,
      but I've found that usually I want the whole block of changes,
      rather than doing it line by line.

      You can read about it at

      :help copy-diffs

      and following where you can read about the above four commands as
      well as some tips on using them.

      Hope this helps,

      -tim




      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Richard Hartmann
      Thanks to the both of you :) --~--~---------~--~----~------------~-------~--~----~ You received this message from the vim_use maillist. For more information,
      Message 2 of 4 , Oct 1, 2007
        Thanks to the both of you :)

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      Your message has been successfully submitted and would be delivered to recipients shortly.