0

I have a split window with two buffers visible, and the top one is active and maximized using CTRL+w, UNDERSCORE (i.e., SHIFT+Minus).

I put the cursor in the middle of the visible buffer, or at the bottom.

Then, I CTRL+w, j, to activate the split on the bottom, and CTRL+w, UNDERSCORE to maximize it. So far, so good.

Now, I go back up to the top split using CTRL+w, k. Again, all good so far.

Finally, I CTRL+w, UNDERSCORE and the buffer maximizes, but now the file has been scrolled (compared to how it looked the last time I was looking at this same buffer in maximized state) such that the cursor is now on the first visible line.

That is to say, the cursor is on the same line of the buffer that it was before, but the contents of the buffer have moved up in the viewport so that the cursor is now at the TOP of the viewport. When I last saw the buffer maximized, the cursor was at the middle or bottom of the viewport.

This is really bugging me. I just today compiled Vim 7.4 and this is not how it used to be in Vim 7.2 (Redhat 6.4). I have verified that Vim 7.2 leaves the viewport how I last left it, but Vim 7.4 does not.

Is there a way to configure Vim 7.4 to act like Vim 7.2 in this regard?

  • 1
    I can't reproduce this using your steps and Vim 7.4.383. It is possible something in your config is changing the behavior. – Heptite Aug 5 '14 at 2:12
  • Hm. I just found out about starting vim with -u NONE and doing that stopped the annoying behavior. How do I find out what plugin is causing the problems? I'll have to do some searching... – Eddified Aug 5 '14 at 16:23
  • The winminheight setting, when set to 0, is the culprit. I turned off all plugins (except the ones that come bundled with vim 7.4) and it's still an issue. When set to 0, it always happens in vim 7.4, and it never happened in vim 7.2 :( – Eddified Aug 5 '14 at 16:51
1

Update, setting winheight=9999 at the same time as winminheight=0 fixes the behavior.

The command below configures Vim for 'Rolodex' mode (aka "poor man's tabs"), which is what I wanted all along:

:set noequalalways winminheight=0 winheight=9999 helpheight=9999

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.