11

When using :vsplit my gvim window jumps to a specific screen location. How do I stop this from happening?

Same thing happens when the second to last split is closed.

I'm using gvim on Windows.

11

This happens because when vertical splitting the window, vim needs to add a vertical scrollbar, which causes vim to recalculate the visual size and eventually makes vim jump to a different screen location. The current workaround is to :set guioptions-=r guioptions-=L

Update

As of patch 8.0.1278, you can also use :set guioptions+=k to prevent Vim from resizing, see also the documentation at :help 'go-k'

  • 2
    Thank you, works great! guioptions-=L seems to be enough for me, I might not have covered all cases though. For anyone wondering :set guioptions-=r removes the right hand side scrollbar and guioptions-=L removes the left one, which appears when using :vsplit. – user3122718 Feb 3 '16 at 14:33

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.