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

anoying horiz scroll when scrolling down

Expand Messages
  • Razvan Rotaru
    Hi, I d like to get rid of an annoying behaviour of vim which happens sometimes when scrolling down. I have a text file with alternately long and short lines.
    Message 1 of 4 , Sep 28, 2011
    • 0 Attachment
      Hi,

      I'd like to get rid of an annoying behaviour of vim which happens sometimes when scrolling down.

      I have a text file with alternately long and short lines. I want to scroll down the file, while keeping an eye on the "right part" of the long lines (wrap is disabled, so 1 text line is displayed on one screen line, and I have scrolled horizontally the text a little bit, to see the end of the long lines).

      What happens when I scroll down, is that the cursor is following along. The problem occurs when the cursor jumps to a short line (which is now out of the screen, because I am scrolled to the right) and vim scrolls me back to the left so that cursor remains in the screen.

      This is incredibly annoying since I have to scroll to the right again.

      I'd really love some hints about how to get rid of this behaviour. I have searched a little bit around, and found that it is not possible to make the cursor not follow the lines (trying to stay on the screen), mainly because vim is a terminal app.

      Cheers,
      Razvan

      --
      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
    • Tim Chase
      ... While it has other side-effects, you might try ... which you can read about at ... It seems to allow me to jump to the end of a long line and then scroll
      Message 2 of 4 , Sep 28, 2011
      • 0 Attachment
        On 09/28/11 07:59, Razvan Rotaru wrote:
        > What happens when I scroll down, is that the cursor is
        > following along. The problem occurs when the cursor jumps to a
        > short line (which is now out of the screen, because I am
        > scrolled to the right) and vim scrolls me back to the left so
        > that cursor remains in the screen.
        >
        > This is incredibly annoying since I have to scroll to the
        > right again.

        While it has other side-effects, you might try

        :set ve=all

        which you can read about at

        :help 'virtualedit'

        It seems to allow me to jump to the end of a long line and then
        scroll downward with the cursor landing in virtual-space on the
        short lines without triggering the horizontal-scroll back to
        where the short lines would normally force me. You can then just
        reset it when you don't want it:

        :set ve=

        -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
      • Francesc Salvat-Pujol
        ... I had a similar problem which was solved by :set nostartofline This prevents the cursor from automatically moving to the first non-blank character: the
        Message 3 of 4 , Sep 28, 2011
        • 0 Attachment
          On 09/28/2011 03:15 PM, Tim Chase wrote:
          > On 09/28/11 07:59, Razvan Rotaru wrote:
          >> What happens when I scroll down, is that the cursor is
          >> following along. The problem occurs when the cursor jumps to a
          >> short line (which is now out of the screen, because I am
          >> scrolled to the right) and vim scrolls me back to the left so
          >> that cursor remains in the screen.
          >>
          >> This is incredibly annoying since I have to scroll to the
          >> right again.
          >
          > While it has other side-effects, you might try
          >
          > :set ve=all
          >
          > which you can read about at
          >
          > :help 'virtualedit'
          >
          > It seems to allow me to jump to the end of a long line and then scroll
          > downward with the cursor landing in virtual-space on the short lines
          > without triggering the horizontal-scroll back to where the short lines
          > would normally force me. You can then just reset it when you don't want it:
          >
          > :set ve=
          >
          > -tim
          >
          >
          >
          >

          I had a similar problem which was solved by :set nostartofline
          This prevents the cursor from automatically moving to the first
          non-blank character: the column is kept.

          HTH,

          Cesc

          --
          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
        • Razvan Rotaru
          virtualedit works. Thanks, Razvan ________________________________ From: Francesc Salvat-Pujol To: vim_use@googlegroups.com Sent:
          Message 4 of 4 , Oct 3, 2011
          • 0 Attachment
            virtualedit works.

            Thanks,
            Razvan


            From: Francesc Salvat-Pujol <f.salvat@...>
            To: vim_use@...
            Sent: Wednesday, September 28, 2011 4:44 PM
            Subject: Re: anoying horiz scroll when scrolling down

            On 09/28/2011 03:15 PM, Tim Chase wrote:
            > On 09/28/11 07:59, Razvan Rotaru wrote:
            >> What happens when I scroll down, is that the cursor is
            >> following along. The problem occurs when the cursor jumps to a
            >> short line (which is now out of the screen, because I am
            >> scrolled to the right) and vim scrolls me back to the left so
            >> that cursor remains in the screen.
            >>
            >> This is incredibly annoying since I have to scroll to the
            >> right again.
            >
            > While it has other side-effects, you might try
            >
            > :set ve=all
            >
            > which you can read about at
            >
            > :help 'virtualedit'
            >
            > It seems to allow me to jump to the end of a long line and then scroll
            > downward with the cursor landing in virtual-space on the short lines
            > without triggering the horizontal-scroll back to where the short lines
            > would normally force me. You can then just reset it when you don't want it:
            >
            > :set ve=
            >
            > -tim
            >
            >
            >
            >

            I had a similar problem which was solved by  :set nostartofline
            This prevents the cursor from automatically moving to the first
            non-blank character: the column is kept.

            HTH,

            Cesc

            --
            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 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
          Your message has been successfully submitted and would be delivered to recipients shortly.