How do I prevent a split window from being resized when I open new splits?
:set winfixwidth winfixheight
How it works When you open new split windows in Vim, the existing windows automatically resize to make room.
:set winfixwidth winfixheight
How it works When you open new split windows in Vim, the existing windows automatically resize to make room.
do (diffget) / dp (diffput)
How it works When you open two files in diff mode (using vim -d file1 file2 or :windo diffthis), Vim highlights the differences between them.
:%bd | e#
How it works Vim does not have a built-in single command to close all buffers except the current one, but you can achieve this with a two-part command: :%bd e#.
<C-w>}
How it works The } command opens a preview window showing the tag definition of the word under your cursor.
:tab sb N
How it works The :tab sb N command opens buffer number N in a brand new tab page.
<C-w>f
How it works You may already know that gf opens the file path under the cursor in the current window.
<C-w>x
How it works The x command exchanges the current window with the next one.
:b N
How it works Every buffer in Vim is assigned a unique number when it is opened.
<C-w>h / <C-w>j / <C-w>k / <C-w>l
How it works Vim lets you navigate between split windows using followed by a direction key.
:bdelete
How it works The :bdelete command (often abbreviated :bd) removes the current buffer from Vim's buffer list and closes it.
<C-w>+
When working with multiple split windows, you often need to resize them to see more content in one pane.
:windo / :bufdo / :tabdo {command}
Vim's do commands iterate over collections and execute a command in each context.
buffers-windows #buffers #windows #tabs #batch-editing #ex-commands
:resize N / :vertical resize N
The :resize and :vertical resize commands set a window to an exact number of lines or columns.
:find filename
The :find command searches for a file by name across all directories in your path setting and opens it.
buffers-windows #buffers #file-management #navigation #workflow
:colder / :cnewer
Vim remembers up to 10 previous quickfix lists.
:b partial<Tab>
The :b (buffer) command accepts partial filename matching with tab completion.
:tabnew | lcd /path/to/project
Vim's :lcd (local change directory) sets the working directory per window.
buffers-windows #buffers #windows #tabs #workflow #project-management
<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
:tabnew / gt / gT
Vim's tab pages let you organize your workspace into separate views, each containing its own window layout.
buffers-windows #buffers #windows #tabs #navigation #productivity
<C-^>
Pressing (Ctrl-6 on most keyboards) instantly toggles between the current buffer and the alternate file — the last file you were editing.
buffers-windows #navigation #buffers #normal-mode #productivity #windows