Re: State of the Cursor
- Lonny Cordell wrote:
> Here are a few examples of how the cursor behaves when switchingYou must be using 'nostartofline'. But for me "j" keeps the same column.
> 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.
Perhaps there is something else in your vimrc that changes this?
> 2. When you switch between files with :e # the cursor is on the rightHmm, CTRL-^ is supposed to be equivalent to ":e #". Perhaps it should obey
> line, but has moved to the beginning of the line.
> 3. If you switch between files with :bn or :bp, the cursor stays in theWith "vim -u NONE" 'startofline' is on.
> right place and goes down in the same column as it should, when j is
> 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.
> I like the behaviour of #3, which implies that all cursor state is":e #" could be made to depend on 'starofline' like CTRL-^ does.
> 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.
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 scrolledThis is what Vi does. Also, Vim doesn't remember the relative cursor position
> 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?
for a file, positioning it in the middle of the window is all that can be done
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 / /