How do I make Vim always open new splits below and to the right instead of above and to the left?
Answer
:set splitright splitbelow
Explanation
By default, :split opens a new window above the current one and :vsplit opens to the left — the opposite of most modern IDEs and editors. Adding set splitright and set splitbelow to your vimrc reverses this, so splits behave in a more intuitive direction.
How it works
splitbelow— when set,:splitand<C-w>sopen the new window below the current onesplitright— when set,:vsplitand<C-w>vopen the new window to the right
Both options only affect where the new window appears; the focus moves to the new window in both cases (unless nosplitbelow/nosplitright is combined with other options).
Example
Without these settings, running :vsplit file.txt in a single-window layout pushes the new window to the left, making the current file jump to the right side. With splitright set, the new window opens on the right and your current file stays in place.
Add to your ~/.vimrc or ~/.config/nvim/init.vim:
set splitright
set splitbelow
Or set both in one line:
set splitright splitbelow
Tips
- Temporarily override per command:
:topleft vsplitopens to the left regardless ofsplitright - Use
:botright splitto always open at the very bottom of the screen - These settings also affect
:help,:terminal, and any plugin that opens a split window - Neovim users can set these in Lua:
vim.opt.splitright = true; vim.opt.splitbelow = true