How do I repeat or reverse inline character search with f, t, ; and , in Vim?
The f, F, t, and T motions search for a character on the current line.
category:
navigation
tags:
#navigation
#motions
#find
#inline-search
How do I jump back to locations where I previously made edits?
Vim tracks every position where you made a change in the changelist.
category:
navigation
tags:
#navigation
#editing
#normal-mode
#motions
How do I move forward or backward by sentence in Vim?
The ) and ( motions move by sentence boundaries.
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I move the cursor to the last non-blank character on the current line?
g moves the cursor to the last non-blank character of the current line — skipping trailing spaces and tabs.
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I scroll the view left or right without moving the cursor in Vim?
When a line is longer than the window width and wrap is off, Vim can display only part of it.
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I jump to the middle of a line in Vim?
The gM command moves the cursor to the horizontal middle of the current line, regardless of how long the line is.
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I reuse the last search pattern without retyping it in Vim?
In Vim, pressing // (two forward slashes) in Normal mode repeats the last search pattern.
category:
search
tags:
#search
#normal-mode
#motions
How do I visually select an entire sentence in Vim?
The vas command visually selects the current sentence, including surrounding whitespace.
category:
visual-mode
tags:
#visual-mode
#text-objects
#motions
How do I jump to the next section or function definition in Vim?
The ]] motion jumps forward to the next line that starts with { in the first column, which is typically the beginning of a C-style function or section.
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I quickly jump to any location with two characters?
s{char}{char} (vim-sneak)
vim-sneak provides a motion that lets you jump to any location specified by two characters.
category:
plugins
tags:
#plugins
#navigation
#motions
How do I record a macro to swap two function arguments?
This macro swaps two comma-separated arguments inside parentheses by cutting the second argument and placing it before the first.
category:
macros
tags:
#macros
#editing
#motions
How do I change from the cursor to the end of the word?
The ce command changes from the cursor position to the end of the current word.
category:
editing
tags:
#editing
#normal-mode
#motions
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 jump between sections using [[ and ]] motions?
The ]] and [[ motions jump between sections, traditionally defined as lines starting with { in the first column.
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I move by display lines when long lines wrap?
The gj command moves the cursor down by one display line rather than one physical line.
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I move the cursor to a specific column on the current line?
The command moves the cursor to a specific screen column on the current line.
category:
navigation
tags:
#navigation
#motions
#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 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 jump to a percentage position in a file?
When used with a count, the % command jumps to the line at that percentage of the file.
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I jump to the start of the next method or function?
The ]m command jumps to the start of the next method in Java-style code.
category:
navigation
tags:
#navigation
#motions
#normal-mode