How do I selectively accept LOCAL or REMOTE changes in a three-way git merge using Vim?
When Vim is configured as a git mergetool, it opens a three-way split with the LOCAL (your branch), REMOTE (their branch), and MERGED (the output file) buffers.
category:
buffers-windows
tags:
#buffers-windows
#diff
#editing
#command-line
How do I toggle the display of hidden dot-files in Vim's built-in netrw file browser?
When browsing files with Vim's built-in netrw file explorer (:Explore or :Ex), hidden files starting with a dot (.
category:
plugins
tags:
#navigation
#buffers-windows
#plugins
How do I run the same Ex command in every open tab page at once?
The :tabdo {cmd} command executes an Ex command in each open tab page sequentially, visiting every tab and running the command there.
category:
buffers-windows
tags:
#tabs
#buffers
#ex-commands
#buffers-windows
How do I make Vim always open new splits below and to the right instead of above and to the left?
:set splitright splitbelow
By default, :split opens a new window above the current one and :vsplit opens to the left — the opposite of most modern IDEs and editors.
category:
config
tags:
#config
#windows
#splits
#buffers-windows
How do I save and restore my entire Vim session including open buffers, windows, and layout?
:mksession saves a snapshot of the current Vim session — all open buffers, window splits, tab pages, cursor positions, and folds — to a file called Session.
category:
buffers-windows
tags:
#buffers-windows
#tabs
#config
#ex-commands
How do I see a diff of my unsaved changes compared to the version on disk?
The command :w !diff % - pipes the current buffer's contents to an external diff command that compares it against the saved file on disk.
category:
buffers-windows
tags:
#buffers-windows
#ex-commands
#editing
#navigation
How do I open a file in a split window and jump directly to the first match of a pattern?
The +{cmd} syntax lets you run an Ex command immediately after a file is opened.
category:
buffers-windows
tags:
#buffers-windows
#navigation
#ex-commands
How do I open all loaded buffers into split windows at once?
The :sball command (short for split all) opens every loaded buffer in its own horizontal split window in one shot.
category:
buffers-windows
tags:
#buffers-windows
#buffers
#windows
#tabs
How do I make Vim reuse an existing window when jumping to a buffer instead of opening a new split?
The switchbuf option controls how Vim decides where to display a buffer when switching to it via commands like :sb, :cc, :cn, quickfix jumps, or .
category:
buffers-windows
tags:
#buffers-windows
#navigation
#ex-commands
#config
How do I control exactly what Vim saves when I create a session with :mksession?
The sessionoptions option (abbreviated ssop) is a comma-separated list of flags that determine what :mksession stores in the session file.
category:
buffers-windows
tags:
#buffers-windows
#config
#workflow
#sessions
How do I execute Ctrl-W window commands from the command line or a Vimscript function?
:wincmd {key} executes any {key} window command from the Ex command line or from inside a Vimscript function.
category:
buffers-windows
tags:
#windows
#ex-commands
#buffers-windows
How do I open all listed buffers as separate tabs at once?
:tab ball (short for :tab sball, "split all buffers in tabs") opens every listed buffer in its own tab page in a single command.
category:
buffers-windows
tags:
#buffers-windows
#tabs
#ex-commands
How do I scroll the view left and right when lines are wider than the screen?
When nowrap is set and lines extend beyond the screen width, Vim provides dedicated horizontal scroll commands.
category:
navigation
tags:
#navigation
#normal-mode
#buffers-windows
How do I open a specific buffer in a new split without navigating away from my current buffer?
:sbuffer {N} opens buffer number N in a new horizontal split, leaving your current window untouched.
category:
buffers-windows
tags:
#buffers-windows
#buffers
#windows
#navigation
How do I open the alternate file in a new split window without typing its name?
Press (Ctrl+W followed by Ctrl+6) to open the alternate file in a horizontal split.
category:
buffers-windows
tags:
#buffers-windows
#navigation
#buffers
How do I run the same Ex command in every open window at once?
:windo {cmd} executes an Ex command in every window in the current tab page, cycling through each one and applying the command before returning focus to the ori
category:
buffers-windows
tags:
#windows
#buffers
#ex-commands
#buffers-windows
How do I send Telescope results to the quickfix list for bulk editing?
While inside any Telescope picker, pressing sends all current results to the quickfix list and closes the picker.
category:
plugins
tags:
#plugins
#search
#quickfix
#buffers-windows
How do I set a different working directory for each split window in Vim?
:lcd (local cd) sets the working directory for the current window only, leaving other windows at their previous directory.
category:
buffers-windows
tags:
#buffers-windows
#navigation
#ex-commands
#config
How do I open the alternate (previously visited) buffer in a new split window?
Vim tracks the alternate buffer — the last file you were editing before the current one.
category:
buffers-windows
tags:
#buffers-windows
#navigation
#windows
How do I automatically equalize window sizes when the terminal is resized?
:autocmd WinResized * wincmd =
When you resize your terminal window, Vim's split layout can become unbalanced.
category:
buffers-windows
tags:
#buffers-windows
#autocmd
#resize
#layout