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

avoiding unneeded buffer scrolling

Expand Messages
  • mzyzik@gmail.com
    All, It bothers me how when switching between tabs (gt) or switching between buffers (:bn, :bp), sometimes a buffer will end up being shifted/scrolled up/down
    Message 1 of 3 , Nov 5, 2006
    • 0 Attachment
      All,

      It bothers me how when switching between tabs (gt) or switching between
      buffers (:bn, :bp), sometimes a buffer will end up being
      shifted/scrolled up/down within its window.

      For the occasions that I want to shift the buffer I have keys like "zz"
      to do this manually. I don't want this to happen automatically. Is there
      any way to avoid this automatic "shifting" that I'm talking about?

      --Matt

      P.S. There is a shift that frequently happens when closing the second to
      last tabpage. The last line of the newly active window will scroll to
      the bottom line of the window.
    • Yakov Lerner
      ... Yes, Matt, there is. Try http://www.vim.org/tips/tip.php?tip_id=1379 Tip #1375: preserve screen *visual* line when switching buffers Yakov
      Message 2 of 3 , Nov 6, 2006
      • 0 Attachment
        On 11/6/06, mzyzik@... <mzyzik@...> wrote:
        > It bothers me how when switching between tabs (gt) or switching between
        > buffers (:bn, :bp), sometimes a buffer will end up being
        > shifted/scrolled up/down within its window.
        >
        > For the occasions that I want to shift the buffer I have keys like "zz"
        > to do this manually. I don't want this to happen automatically. Is there
        > any way to avoid this automatic "shifting" that I'm talking about?

        Yes, Matt, there is.
        Try http://www.vim.org/tips/tip.php?tip_id=1379
        "Tip #1375: preserve screen *visual* line when switching buffers"

        Yakov
      • Matt Zyzik
        Yakov, Your tip is great. It fixed the first problem (with :bn, :bp). However, it does not take care of the second problem, regarding the tabs. In addition,
        Message 3 of 3 , Nov 6, 2006
        • 0 Attachment
          Yakov,

          Your tip is great. It fixed the first problem (with :bn, :bp). However, it
          does not take care of the second problem, regarding the tabs.

          In addition, Yakov, I've found some instances where your tip fails to
          work. It must be a bug in vim, because the tip's code looks fine.

          --Matt

          > On 11/6/06, mzyzik@... <mzyzik@...> wrote:
          >> It bothers me how when switching between tabs (gt) or switching between
          >> buffers (:bn, :bp), sometimes a buffer will end up being
          >> shifted/scrolled up/down within its window.
          >>
          >> For the occasions that I want to shift the buffer I have keys like "zz"
          >> to do this manually. I don't want this to happen automatically. Is there
          >> any way to avoid this automatic "shifting" that I'm talking about?
          >
          > Yes, Matt, there is.
          > Try http://www.vim.org/tips/tip.php?tip_id=1379
          > "Tip #1375: preserve screen *visual* line when switching buffers"
          >
          > Yakov
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.