How do I open the current file in a preview window at a specific pattern?
When you need a second read-only view of the same file, opening more normal splits can disrupt your working layout.
category:
buffers-windows
tags:
#buffers
#windows
#preview
#workflow
How do I keep the quickfix window height from resizing when splitting?
Quickfix windows are easy to disturb when you open, close, or rebalance other splits.
category:
buffers-windows
tags:
#buffers
#windows
#quickfix
#layout
How do I search files on 'path' and open the first match in the preview window instead of replacing my current buffer?
When you need quick context from another file but do not want to disturb your current editing window, :psearch gives you a clean workflow.
category:
buffers-windows
tags:
#buffers
#windows
#preview-window
#search
#navigation
How do I make buffer jumps prefer the last-used window that already shows the target buffer?
When jumps open the target buffer in an unexpected split, context switching gets expensive.
category:
buffers-windows
tags:
#buffers
#windows
#navigation
#config
How do I open the alternate buffer in a new split while keeping my current window unchanged?
If you often compare your current file against the previously visited buffer, replacing the current window is disruptive.
category:
buffers-windows
tags:
#buffers
#windows
#splits
#navigation
How do I save only modified files across the argument list in Vim?
When working through an argument list, many files may remain unchanged.
category:
command-line
tags:
#command-line
#buffers
#ex-commands
#refactoring
How do I enable synchronized scrolling in every open window?
:windo setlocal scrollbind
When reviewing related files side by side, manually keeping splits aligned wastes attention.
category:
buffers-windows
tags:
#buffers
#windows
#navigation
#ex-commands
How do I build a location list of TODO matches across a project?
:lvimgrep /\<TODO\>/gj **/* | lopen
If you want project-wide search results without polluting the global quickfix list, use a location list.
category:
search
tags:
#search
#quickfix
#buffers
#windows
#ex-commands
How do I keep the top line stable while changing split layouts in Neovim?
When you open, close, or resize splits in long files, the visible window region can shift in ways that break your reading flow.
category:
buffers-windows
tags:
#buffers
#windows
#layout
#config
How do I edit another file without changing the alternate-file (#) reference?
:keepalt edit path/to/file\<CR>
Experienced Vim workflows often depend on the alternate file (#) for fast toggling with , quick diffs, or two-file review loops.
category:
buffers-windows
tags:
#buffers
#windows
#command-line
#navigation
How do I run a replacement only over the current window's location-list matches?
:ldo s/foo/bar/ge | update\<CR>
:ldo is one of the most effective ways to perform targeted, multi-file edits without touching unrelated text.
category:
command-line
tags:
#command-line
#search
#ex-commands
#buffers
How do I search a project but keep results window-local using the location list instead of quickfix?
:lvimgrep /TODO/j **/* | lopen\<CR>
When you are working in multiple windows, quickfix can become noisy because it is shared globally across the editor session.
category:
search
tags:
#search
#ex-commands
#buffers
#windows
How do I open the current file at a previous Git revision with vim-fugitive?
When you are deep in a refactor, you often need to compare the current buffer with an older version of the same file.
category:
plugins
tags:
#plugins
#git
#fugitive
#buffers
#history
How do I open and edit a file directly inside a tar archive in Vim?
:e archive.tar::path/to/file
Vim's built-in tar.
category:
plugins
tags:
#plugins
#buffers
#editing
#workflow
How do I stop Vim from auto-equalizing split sizes when opening or closing windows?
When you work with carefully sized splits, Vim's default behavior can feel disruptive: opening or closing a window triggers an automatic rebalance.
category:
buffers-windows
tags:
#windows
#buffers
#config
#workflow
How do I open another buffer in a split without changing the alternate-file register?
The alternate-file register (#) is easy to disturb when jumping around buffers, and many advanced motions depend on it (, # expansions, quick two-file toggles).
category:
buffers-windows
tags:
#buffers
#windows
#command-line
#navigation
How do I open another file without changing the alternate-file mark (#)?
The alternate-file mark (#) powers fast toggles like and commands that depend on the previous file context.
category:
command-line
tags:
#command-line
#buffers
#workflow
#navigation
#advanced
How do I open another file without saving the current modified buffer first?
Normally, trying to :edit another file from a modified buffer triggers a warning and blocks the switch unless you save or force the command.
category:
buffers-windows
tags:
#buffers
#windows
#workflow
#command-line
#editing
How do I keep a utility split from resizing when other windows open or close?
:setlocal winfixheight winfixwidth
If you use a dedicated utility pane (logs, quick notes, REPL output), Vim's default equalization behavior can keep resizing it whenever other splits change.
category:
buffers-windows
tags:
#buffers
#windows
#config
#ex-commands
How do I run a search-and-replace across all files in my argument list and only save changed buffers?
:argdo %s/\<old\>/new/ge | update
When you need to apply the same substitution across a curated set of files, :argdo is safer than a broad project-wide command.
category:
command-line
tags:
#command-line
#ex-commands
#search
#buffers
#formatting