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 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 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
How do I save only real file buffers when running bufdo across many open buffers?
:bufdo if &buftype ==# '' | update | endif
bufdo is powerful for multi-buffer automation, but a naive write pass can error on special buffers (help, terminal, quickfix, prompts).
category:
buffers-windows
tags:
#buffers
#windows
#ex-commands
#automation
#workflow
How do I set each window's local working directory to its buffer path?
When multiple splits point at files from different projects, relative-path commands can become inconsistent and error-prone.
category:
buffers-windows
tags:
#buffers
#windows
#command-line
#workflow
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.
category:
buffers-windows
tags:
#buffers
#windows
#config
#navigation
How do I open a floating window showing diagnostic details at the cursor using a built-in Neovim key?
Neovim 0.
category:
buffers-windows
tags:
#diagnostics
#lsp
#floating-window
#neovim
#buffers
#windows
How do I execute a single normal mode command inside a Neovim terminal buffer without fully leaving terminal mode?
In a Neovim terminal buffer, exits to normal mode permanently.
category:
buffers-windows
tags:
#terminal
#buffers-windows
#insert-mode
#neovim
#normal-mode
How do I control windows using Ex commands in scripts and mappings instead of Ctrl-W shortcuts?
:wincmd {key} is the Ex command equivalent of every {key} window shortcut.
category:
buffers-windows
tags:
#buffers-windows
#windows
#ex-commands
#normal-mode
How do I save multiple different views of the same file with independent fold and cursor states?
:mkview 2 and :loadview 2
Vim supports up to 9 numbered view slots per file.
category:
buffers-windows
tags:
#folding
#buffers-windows
#navigation
#config
How do I push or pull a single diff hunk between buffers with a single keystroke in diff mode?
In Vim's diff mode, dp (diff put) and do (diff obtain) are single-keystroke shorthands for :diffput and :diffget.
category:
buffers-windows
tags:
#diff
#buffers-windows
#editing
#normal-mode