How do I load shell search output into a window-local location list?
:lgetexpr systemlist('rg --vimgrep TODO %') | lopen
When you want search results tied to only the current window, use :lgetexpr instead of :cgetexpr.
category:
buffers-windows
tags:
#location-list
#quickfix
#buffers
#command-line
#search
How do I open a scratch split that is not listed and disappears when I close it?
:vnew | setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile
For quick throwaway notes, command output cleanup, or temporary edits, a normal buffer is noisy: it appears in :ls, can prompt you to save, and may leave swap a
category:
buffers-windows
tags:
#buffers-windows
#buffers
#windows
#scratch
#workflow
How do I remove trailing whitespace across all open buffers and save only changed files?
:bufdo keeppatterns %s/\s\+$//e | update
If you keep many files open during a refactor, cleaning trailing whitespace one buffer at a time is slow and error-prone.
category:
buffers-windows
tags:
#buffers
#command-line
#editing
#whitespace
How do I move the current split into a new tab and immediately jump back to the previous tab?
When a split temporarily becomes the center of attention, promoting it to its own tab can reduce layout noise.
category:
buffers-windows
tags:
#buffers
#windows
#tabs
#navigation
How do I tune Vim diff so moved code blocks align more accurately?
:set diffopt+=internal,algorithm:histogram,indent-heuristic
Default diff settings are fine for small edits, but they can produce noisy hunks when code is moved or indentation shifts.
category:
config
tags:
#config
#buffers
#windows
#editing
How do I rotate split windows forward without reopening any buffers?
When a split layout is correct but the window positions are awkward, you do not need to close and reopen anything.
category:
buffers-windows
tags:
#windows
#buffers
#command-line
#navigation
How do I populate a window-local location list for only the current file using ripgrep output?
:call setloclist(0, [], 'r', {'title': 'TODO current file', 'lines': systemlist('rg --vimgrep TODO ' . shellescape(expand('%:p'))), 'efm': '%f:%l:%c:%m'})
For focused review work, a window-local location list is often better than global quickfix.
category:
buffers-windows
tags:
#buffers
#windows
#location-list
#search
#quickfix
How do I jump to an already-open file window instead of opening duplicate buffers?
When the same file is already open elsewhere, using :edit can create extra navigation friction because you stay in the current window and may lose layout contex
category:
buffers-windows
tags:
#buffers-windows
#windows
#buffers
#workflow
How do I make buffer-jump commands reuse an existing tab before opening a new one?
:set switchbuf=usetab,newtab
When you jump to buffers from quickfix, tags, or command-line completions, Vim's default window selection can feel unpredictable.
category:
buffers-windows
tags:
#buffers
#windows
#tabs
#quickfix
#navigation
How do I collapse every tab page to a single window without closing tabs?
When you are deep in a refactor, each tab can accumulate helper splits, previews, and temporary views.
category:
buffers-windows
tags:
#buffers
#windows
#tabs
#ex-commands
#workflow
How do I put all visible windows into diff mode and balance their sizes in Vim?
:windo diffthis | wincmd =<CR>
When you already have multiple related buffers open, you can enter diff mode across all visible windows in one shot and then normalize layout width/height immed
category:
buffers-windows
tags:
#buffers
#windows
#diff
#ex-commands
How do I quickly filter a quickfix list using Vim's built-in cfilter plugin?
:packadd cfilter | Cfilter /pattern/
Large quickfix lists are hard to work with when you only care about one subset of matches.
category:
plugins
tags:
#plugins
#command-line
#search
#buffers
How do I run a window-local setting command in every open window?
:windo setlocal colorcolumn=+1
When a setting is window-local, changing it once does not affect your other splits.
category:
buffers-windows
tags:
#buffers
#windows
#ex-commands
#formatting
How do I make Vim equalize split windows only horizontally?
If you use many splits, automatic equalization can feel disruptive when Vim resizes both height and width after layout changes.
category:
buffers-windows
tags:
#buffers
#windows
#layout
#options
How do I show only buffers matching a pattern in Vim's :ls output?
When you have many open buffers, plain :ls output gets noisy fast.
category:
buffers-windows
tags:
#buffers
#command-line
#regex
#workflow
How do I keep project search results window-local with a location list?
:lvimgrep /TODO/j **/* | lopen
When you are working in split-heavy sessions, global quickfix results can become noisy because every window shares the same list.
category:
search
tags:
#search
#quickfix
#buffers
#windows
#command-line
How do I open an already-loaded buffer in a new tab without re-reading it from disk?
If a file is already loaded as a buffer, reopening it with :tabedit can trigger another read and may lose the exact in-memory context you want.
category:
buffers-windows
tags:
#buffers
#windows
#tabs
#command-line
How do I keep a split at a fixed width when opening and closing other windows?
When you use a sidebar-style split for file trees, docs, or logs, automatic window equalization can constantly resize it.
category:
buffers-windows
tags:
#buffers
#windows
#layout
#workflow
How do I make jumps reuse open windows first and fall back to a new tab when needed?
:set switchbuf=useopen,usetab,newtab
When jump commands open files (:tag, quickfix navigation, location list jumps), Vim may split your layout in ways that break flow.
category:
buffers-windows
tags:
#buffers
#windows
#tabs
#quickfix
#config
How do I open quickfix at the bottom with a fixed height and keep cursor focus in my editing window?
:botright copen 8 | wincmd p
Quickfix is powerful, but opening it can disrupt window layout and yank focus away from your current editing context.
category:
buffers-windows
tags:
#buffers
#windows
#quickfix
#command-line