How do I cycle through my previous deletions to find the one I want to paste?
Vim stores your last 9 deletions (of one line or more) in the numbered registers "1 through "9.
category:
registers
tags:
#registers
#editing
#normal-mode
#undo-redo
#paste
How do I run a command on lines near each match, not just the matching line itself?
The :g (global) command normally operates on lines that match a pattern.
category:
command-line
tags:
#ex-commands
#editing
#search
#global
How do I quickly change an entire sentence in Vim?
The cis command deletes the entire sentence under the cursor and drops you into insert mode, ready to type a replacement.
category:
editing
tags:
#editing
#text-objects
#normal-mode
#motions
#prose
How do I change text from the cursor to the end of the line?
The C command deletes everything from the cursor position to the end of the line and places you in insert mode.
category:
editing
tags:
#editing
#normal-mode
#insert-mode
How do I split a single-line code statement into multiple lines or join them back in Vim?
The splitjoin.
category:
plugins
tags:
#plugins
#splitjoin
#editing
#refactoring
#formatting
How do I navigate undo branches to recover changes that were overwritten by a new edit?
Vim doesn't have a simple linear undo stack — it maintains a full undo tree with branches.
category:
editing
tags:
#editing
#undo-redo
#normal-mode
#advanced
#productivity
How do I jump to the beginning of a file in Vim?
The gg command moves the cursor to the first line of the file.
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I preview, stage, and navigate Git hunks inline with gitsigns?
gitsigns.
category:
plugins
tags:
#plugins
#git
#gitsigns
#version-control
How do I delete or change an entire paragraph of text in one motion?
The dap and dip commands use Vim's paragraph text objects to delete an entire block of contiguous text in a single motion.
category:
editing
tags:
#editing
#text-objects
#normal-mode
#delete
#motions
How do I stage and unstage Git files without leaving Vim?
The vim-fugitive plugin by Tim Pope provides an interactive Git status window that lets you stage, unstage, diff, and commit files entirely from within Vim.
category:
plugins
tags:
#plugins
#fugitive
#git
#staging
#workflow
How do I run the same command across all windows, buffers, or tabs?
:windo / :bufdo / :tabdo {command}
Vim's do commands iterate over collections and execute a command in each context.
category:
buffers-windows
tags:
#buffers
#windows
#tabs
#batch-editing
#ex-commands
How do I evaluate expressions and insert results inline in Vim?
The expression register (=) is one of Vim's most powerful yet underused features.
category:
registers
tags:
#registers
#insert-mode
#ex-commands
#editing
How do I use ALE to automatically lint and fix code in Vim?
ALE (Asynchronous Lint Engine) is a popular Vim plugin that runs linters and formatters asynchronously in the background, showing errors and warnings in the gut
category:
plugins
tags:
#plugins
#linting
#formatting
How do I uppercase a word in Vim?
The gUiw command converts the entire word under the cursor to uppercase.
category:
editing
tags:
#editing
#text-objects
#normal-mode
#formatting
How do I set up efficient keybindings for cycling through buffers?
Mapping ]b and [b to :bnext and :bprev creates an intuitive bracket-style navigation for buffers, matching the convention used by unimpaired.
category:
buffers-windows
tags:
#buffers-windows
#navigation
#mapping
#buffers
How do I fuzzy-search and switch between open buffers in Vim?
The fzf.
category:
plugins
tags:
#plugins
#fzf
#buffers
#navigation
#workflow
How do I swap the contents of two split windows in Vim?
How it works The x command exchanges the current window with the next one.
category:
buffers-windows
tags:
#windows
#navigation
#normal-mode
How do I reformat text to fit the line width without moving the cursor?
The gw operator reformats text just like gq, but leaves the cursor in its original position after reformatting.
category:
editing
tags:
#editing
#formatting
#motions
#text-objects
What is the difference between 0 and ^ for moving to the beginning of a line?
Vim has two distinct motions for moving to the start of a line: 0 goes to column 1 (the absolute start), while ^ goes to the first non-blank character.
category:
navigation
tags:
#navigation
#motions
#line-navigation
#indentation
How do I join lines without adding spaces between them?
The gJ command joins the current line with the line below it without inserting any space between them.
category:
editing
tags:
#editing
#normal-mode
#text-manipulation
#join