How do I open the alternate buffer in a new split while keeping my current window unchanged?
:leftabove sbuffer #
If you often compare your current file against the previously visited buffer, replacing the current window is disruptive.
:leftabove sbuffer #
If you often compare your current file against the previously visited buffer, replacing the current window is disruptive.
:set winminheight=0
By default, Vim enforces a minimum window height of 1 line, which means you can never fully collapse a split.
buffers-windows #buffers-windows #windows #splits #navigation
:vertical {cmd}
The :vertical command modifier forces any window-opening Ex command to create a vertical split instead of the default horizontal split.
buffers-windows #windows #buffers #command-line #splits #ex-commands
:vert {cmd}
Vim's :vertical modifier (abbreviated :vert) can be prepended to any Ex command that opens a split window to make it open as a vertical split instead of a horiz
buffers-windows #buffers-windows #windows #splits #ex-commands
:set splitkeep=screen
Controls how Neovim preserves the visual position of content when creating, closing, or resizing horizontal splits.
: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.
:topleft split {file}
By default, Vim places horizontal splits below and vertical splits to the right (controlled by splitbelow and splitright).
<C-w>| and <C-w>_ / <C-w>=
Vim lets you temporarily maximize a split window to full width or full height, and then restore all windows to equal sizes with =.
buffers-windows #windows #splits #navigation #productivity #layout
: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
<C-w>H / <C-w>J / <C-w>K / <C-w>L
The H, J, K, and L commands move the current window to the far left, bottom, top, or right of the screen respectively, rearranging your entire split layout.
buffers-windows #windows #buffers #navigation #splits #layout