How do I swap two adjacent lines?
ddp
The ddp sequence swaps the current line with the line below it.
ddp
The ddp sequence swaps the current line with the line below it.
<C-a>
The command increments the number under or after the cursor by 1.
X
The X command deletes the character to the left of the cursor (before it).
dip
The dip command deletes the inner paragraph — all contiguous non-blank lines surrounding the cursor.
<C-x>
The command decrements the number under or after the cursor by 1.
ce
The ce command changes from the cursor position to the end of the current word.
==
The == command auto-indents the current line based on the surrounding context.
cc
The cc command deletes the entire content of the current line (preserving indentation) and enters insert mode.
/\_.pattern
The \.
/\<word\>
The \ atoms create word boundaries in a search pattern, matching only complete words and not substrings within larger words.
/\v pattern
The \v flag enables "very magic" mode in Vim regex, where most special characters work like standard regular expressions without needing backslashes.
n
After performing a search with / or ?, pressing n repeats the search in the same direction to find the next match.
/pattern\n next-line
Using \n in a Vim search pattern matches a newline character, allowing you to find patterns that cross line boundaries.
/pattern\@!
The \@! atom is a negative lookahead in Vim regex.
\@<=pattern
The \@<= atom is a positive lookbehind in Vim regex.
/pattern\ze followed
The \ze atom marks the end of the match, so you can match a pattern only when it appears before specific text.
/{pattern}
The / command initiates a forward search in the file.
?{pattern}
The ? command searches backward from the cursor position.
(
The ( motion moves the cursor backward to the start of the current or previous sentence.
`[ and `]
The ` [ ` and ] ` marks automatically track the boundaries of the last changed or yanked text.