How do I scroll a full page up or down in Vim?
<C-f> to scroll forward, <C-b> to scroll backward
How it works Vim provides two commands for scrolling by an entire screen (page) at a time: Ctrl-F (Forward) scrolls the view one full page down through the file
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I jump to the next unmatched closing parenthesis?
The ]) command moves forward to the next unmatched ).
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I select or operate on a block of code based on its indentation level in Vim?
The vim-indent-object plugin by Michael Smith adds text objects based on indentation level, giving you ii (inner indent) and ai (an indent) to select, delete, c
category:
plugins
tags:
#plugins
#indent
#text-objects
#editing
#python
How do I open a file in a new tab in Vim?
The :tabnew filename command opens a file in a new tab page in Vim.
category:
buffers-windows
tags:
#buffers-windows
#tabs
#ex-commands
#navigation
How do I reformat a paragraph or visual selection to fit a specific line width?
The gq operator reformats text to fit within your configured textwidth.
category:
visual-mode
tags:
#visual-mode
#formatting
#editing
#text-objects
How do I jump forward through the jump list after going back with Ctrl-O?
Every time you make a "jump" — using G, /, %, :tag, , or similar commands — Vim records your position in the jump list.
category:
navigation
tags:
#navigation
#normal-mode
How do I search for a whole word only, excluding partial matches?
The \ atoms create word boundaries in a search pattern, matching only complete words and not substrings within larger words.
category:
search
tags:
#search
#normal-mode
How do I prevent duplicate autocommands when reloading vimrc?
augroup name | autocmd! | ... | augroup END
Using augroup with autocmd! inside prevents duplicate autocommands from accumulating when you reload your vimrc.
category:
config
tags:
#config
#command-line
#ex-commands
How do I open the command-line window while typing a command on the : prompt?
<C-f> (from command-line mode)
When you are partway through typing a long or complex Ex command on the : prompt, you can press to open the command-line window.
category:
search
tags:
#command-line
#ex-commands
#editing
#normal-mode
How do I replace the contents of the entire current line?
The cc command deletes the entire content of the current line (preserving indentation) and enters insert mode.
category:
editing
tags:
#editing
#normal-mode
How do I jump backward to the previous sentence?
The ( motion moves the cursor backward to the start of the current or previous sentence.
category:
navigation
tags:
#navigation
#motions
#normal-mode
#text-objects
How do I search forward for text in Vim?
The / command initiates a forward search in the file.
category:
search
tags:
#search
#normal-mode
How do I access the text from my last insert session?
The .
category:
registers
tags:
#registers
#editing
#normal-mode
How do I get language support for many programming languages at once?
Plug 'sheerun/vim-polyglot'
vim-polyglot is a collection of language packs for Vim.
category:
plugins
tags:
#plugins
#config
How do I search and replace text containing special characters?
:%s/\V literal.text/replacement/g
The \V (very nomagic) flag treats all characters as literal except for \.
category:
search
tags:
#search
#ex-commands
How do I match a pattern only if it is NOT followed by something?
The \@! atom is a negative lookahead in Vim regex.
category:
search
tags:
#search
#normal-mode
How do I use the expression register for calculations?
The expression register = evaluates a Vimscript expression and stores the result.
category:
registers
tags:
#registers
#editing
#normal-mode
How do I jump to the next unmatched opening brace?
The [{ command moves backward to the nearest unmatched {.
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I increment a number under the cursor?
The command increments the number under or after the cursor by 1.
category:
editing
tags:
#editing
#normal-mode
How do I join all selected lines into one line?
In visual mode, pressing J joins all selected lines into a single line with spaces between them.
category:
visual-mode
tags:
#visual-mode
#editing