How do you open a new file in a vertical split?
:vsplit filename
Use :vsplit filename or :vsp filename to open a file in a new vertical split to the left of the current window.
38 results for ":vsplit"
:vsplit filename
Use :vsplit filename or :vsp filename to open a file in a new vertical split to the left of the current window.
:vsplit
The :vsplit command (or :vs for short) splits the current window vertically, creating a new window side-by-side with the current one.
:set splitbelow splitright
How it works By default, Vim opens horizontal splits (:split or :sp) above the current window and vertical splits (:vsplit or :vsp) to the left.
:set splitright splitbelow
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.
:set scrollbind
The scrollbind option locks the scrolling of two or more windows together so they scroll in unison.
:diffthis in both windows
The :diffthis command enables diff mode for the current buffer.
:botright split
When you split a window with :split or :vsplit, Vim subdivides only the current window.
buffers-windows #buffers #windows #ex-commands #command-line
:split #
In Vim, # is a special filename that always refers to the alternate file — the most recently active buffer before the current one.
:set winfixwidth
Setting winfixwidth on a window tells Vim not to adjust its width when other windows are created, closed, or resized with =.
<C-w>v
Press v or use :vsplit to create a vertical split showing the same buffer.
:split
The :split command (or s) splits the current window horizontally, creating a new window above with the same file.
:e +/pattern filename
The +{cmd} flag on :edit (and most file-opening commands) runs an Ex command immediately after the file loads.
command-line #command-line #ex-commands #navigation #search #buffers
:set switchbuf=useopen,usetab
By default, Vim opens a new window (or reloads the buffer in the current window) whenever you navigate to a quickfix entry, tag, or :buffer command — even if
<C-\>e
Pressing e on the command line opens a special prompt that lets you type a Vimscript expression.
command-line #command-line #ex-commands #vimscript #insert-mode
:topleft split {file}
By default, Vim places horizontal splits below and vertical splits to the right (controlled by splitbelow and splitright).
:set winfixwidth winfixheight
How it works When you open new split windows in Vim, the existing windows automatically resize to make room.
:set switchbuf=useopen
The switchbuf option controls how Vim decides where to display a buffer when switching to it via commands like :sb, :cc, :cn, quickfix jumps, or .
buffers-windows #buffers-windows #navigation #ex-commands #config
:Telescope find_files
Telescope is a highly extensible fuzzy finder for Neovim.
:windo set scrollbind
The scrollbind option locks two or more windows together so that scrolling in one window automatically scrolls the others by the same amount.
buffers-windows #windows #navigation #splits #diff #productivity
:set cursorbind
:set cursorbind (or :setlocal cursorbind) locks the cursor's column position so it moves in sync across all windows that have cursorbind enabled.