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.
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communityWhen 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.
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'
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