Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The problem

Somehow on this box every time I split a window (^W v or :vs) the original pane scrolls in such a way that my cursor is exactly scrolloff=5 from the top.

I have tried to remove all ~/.vim* and /etc/vim* files but no dice. Even a aptitude purge vim followed by a rm -rf /usr/share/vim/ /etc/vim* didn't change anything.

Note: This seems to be specific to a certain Vim version since I do not have this on my other boxes with the same .vimrc.


Versions

  • Vim: 7.3
  • Ubuntu: 11.04
share|improve this question
    
Just want to add that I am having the same problem during vertical splits and don't know how to debug any further. Vim: 7.2, RHEL: 6.2. –  Marco A May 1 '12 at 19:33

2 Answers 2

This was a bug, fixed in Vim 7.3, patch 084.

If you type (in a console/konsole/terminal/gnome-terminal...)

vim --version | head

you'll be able to see the version and patchlevel of your current vim/gvim.

You can also do this from within Vim itself:

:version

it'll paginate for you and you can read the version and patchlevel in the top of the first screen.

share|improve this answer
    
I would assume my version is new enough: VIM - Vi IMproved 7.3 (2010 Aug 15, compiled May 4 2012 04:22:36) Included patches: 1-429 –  Wolph Jul 7 '12 at 12:16
    
Yup. Bummer! I'll keep this issue in mind, maybe I'll come across something. –  lornix Jul 7 '12 at 13:18
    
Really odd... I remember seeing my system do the 'unexpected scroll when splitting window', like you describe, a few weeks ago. But now I can't reproduce it at all. And all within Vim v7.3.300+. I've upgraded at least once, now sitting at v7.3 p547. Very odd. Hmm, does it only do it on certain file TYPES? MOAR TESTING! {Grin} –  lornix Jul 8 '12 at 11:43
    
Hrm... now that you mention it, I cannot reproduce it on all of my machines. I know I had the problem in the past but not anymore. The machine where I have the problem (with all filetypes, even when opening an empty buffer) is using this version: VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Jun 25 2011 09:43:11) Included patches: 1-411 (Centos 6) –  Wolph Jul 9 '12 at 9:48
    
Glad to know I'm not going crazy (again!). Ah, the fix was 7.3.84, that machine is 7.2.411.. –  lornix Jul 9 '12 at 11:23
up vote 0 down vote accepted

It seems to be caused by Vim not knowing the window size the first time. After the first time it works just fine.

So to work around this issue, I have added this to my .vimrc:

" Little hack to fix the split/scroll problem 
tabnew
bwipeout
share|improve this answer
    
this actually causes another bug within the status bar.... not worth it IMO –  xckpd7 Nov 26 '12 at 20:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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