How do I make the fold column appear only when needed and cap its width?
If you use folds heavily, a fixed fold column is a tradeoff: foldcolumn=0 hides useful fold cues, while a constant width wastes horizontal space in files that b
category:
config
tags:
#config
#folding
#ui
#windows
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 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 stop :mkview from restoring local options when loading a view?
:set viewoptions-=options
When you use :mkview and :loadview, Vim stores more than folds and cursor position.
category:
config
tags:
#config
#views
#folding
#session-management
#windows
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 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
How do I open netrw in a left sidebar rooted at the current file's directory?
When you are editing deep in a project, opening netrw from the working directory often puts you in the wrong place.
category:
plugins
tags:
#plugins
#buffers
#windows
#navigation
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