How do I make the active window automatically expand to take up most of the screen?
:set winheight=999 winminheight=5
Setting winheight to a very large number forces Vim to always try to make the focused window as tall as possible.
:set winheight=999 winminheight=5
Setting winheight to a very large number forces Vim to always try to make the focused window as tall as possible.
<C-w>d
Neovim 0.
buffers-windows #diagnostics #lsp #floating-window #neovim #buffers #windows
:wincmd {cmd}
:wincmd {key} is the Ex command equivalent of every {key} window shortcut.
buffers-windows #buffers-windows #windows #ex-commands #normal-mode
<C-w>F
F opens the filename under the cursor in a new horizontal split window and jumps to the line number that follows the filename.
buffers-windows #navigation #buffers-windows #windows #editing
: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
z{height}<CR>
The z{height} command simultaneously resizes the current window to exactly {height} lines, scrolls so the current line sits at the top of the window, and moves
buffers-windows #buffers-windows #windows #resize #navigation
:set winfixbuf
Neovim's winfixbuf option (added in Neovim 0.
<C-w>z
Pressing z closes the preview window from any window in the current tab page.
:sview {file}
The :sview command opens a file in a horizontal split window with the buffer set to read-only.
buffers-windows #buffers-windows #windows #navigation #ex-commands
winrestcmd()
The winrestcmd() function returns a string of Ex commands that, when executed, restore all window sizes to their state at the time of the call.
:set winwidth=999 winheight=999
Setting winwidth=999 and winheight=999 tells Vim to try to make the active window at least 999 columns wide and 999 rows tall whenever it gains focus.
:sfind {file}
:sfind (split-find) searches Vim's path setting for a file matching the given name and opens it in a new horizontal split, all in one command.
<C-w>t and <C-w>b
When managing multiple splits, t jumps to the top-left window and b jumps to the bottom-right window.
<C-w>P
The preview window is a special auxiliary split — usually at the top — opened by commands like :ptag, :pedit, and omni-completion to display reference infor
{n}<C-w>>
All four window resize mappings accept an optional count prefix that multiplies the resize amount.
<C-w>g]
g] splits the window and then runs :tselect for the identifier under the cursor, displaying a numbered list of all matching tags so you can pick the exact defin
:set winfixwidth
Setting winfixwidth on a window tells Vim not to adjust its width when other windows are created, closed, or resized with =.
:wincmd {key}
:wincmd is the Ex command equivalent of any keystroke.
z{N}<CR>
The z{N} command sets the current window's height to exactly N lines and simultaneously positions the current line at the top of the window.
<C-w>H and <C-w>K
After opening a split you can dynamically reposition windows using H, J, K, and L.
buffers-windows #windows #buffers-windows #navigation #normal-mode