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

Re: State of the Cursor

Expand Messages
  • Bram Moolenaar
    ... You must be using nostartofline . But for me j keeps the same column. Perhaps there is something else in your vimrc that changes this? ... Hmm, CTRL-^
    Message 1 of 2 , Feb 18, 2000
    • 0 Attachment
      Lonny Cordell wrote:

      > Here are a few examples of how the cursor behaves when switching
      > between
      > files using three different methods.
      >
      > 1. When you switch between files with CRTL-^ the cursor retains its
      > position, but it jumps to the beginning of the next line when you press
      > down (j) even if there is text in the column beneath the cursor.

      You must be using 'nostartofline'. But for me "j" keeps the same column.
      Perhaps there is something else in your vimrc that changes this?

      > 2. When you switch between files with :e # the cursor is on the right
      > line, but has moved to the beginning of the line.

      Hmm, CTRL-^ is supposed to be equivalent to ":e #". Perhaps it should obey
      'starofline' too?

      > 3. If you switch between files with :bn or :bp, the cursor stays in the
      > right place and goes down in the same column as it should, when j is
      > pressed.
      >
      > This occurs in both console and gui (version info is below).
      > With vim -u NONE -U NONE, all three cases have the same behavior as #2.

      With "vim -u NONE" 'startofline' is on.

      > I like the behaviour of #3, which implies that all cursor state is
      > saved when switching away from the window and reloaded when switching
      > back to the window.
      >
      > Why do #1 and #2 behave the way they do? Bug or feature?
      > I assume that vim -u NONE is behaving in the vi compatible mode, which
      > is probably correct.

      ":e #" could be made to depend on 'starofline' like CTRL-^ does.

      I don't know why the cursor moves to the beginning of the line when using "j"
      for #1. That looks like a bug, but I should be able to reproduce this before
      I can be sure about that.

      > Similarly, when switching back to a file, if the window can be scrolled
      > then the cursor line is placed in the middle of the window. This
      > sounds to me like an automatic zz is happening somewhere. Is this a
      > setting I'm not aware of?

      This is what Vi does. Also, Vim doesn't remember the relative cursor position
      for a file, positioning it in the middle of the window is all that can be done
      now.

      --
      hundred-and-one symptoms of being an internet addict:
      31. You code your homework in HTML and give your instructor the URL.

      /-/-- Bram Moolenaar --- Bram@... --- http://www.moolenaar.net --\-\
      \ \ Vim: http://www.vim.org ICCF Holland: http://www.vim.org/iccf / /
    Your message has been successfully submitted and would be delivered to recipients shortly.