How do I put selected text inside quotes or brackets manually?
c""<Esc>P
Without a surround plugin, you can manually wrap selected text by changing it, typing the delimiters, and pasting the original text back.
c""<Esc>P
Without a surround plugin, you can manually wrap selected text by changing it, typing the delimiters, and pasting the original text back.
<C-v>jjjg<C-a>
Selecting a column of identical numbers with visual block mode and pressing g turns them into an incrementing sequence.
u (in visual mode)
In visual mode, pressing u converts all selected text to lowercase.
visual select + d, move, P
To swap two pieces of text, delete the first selection, navigate to the second, select it, and paste.
>
In visual mode, pressing > indents all selected lines by one shiftwidth.
J (in visual mode)
In visual mode, pressing J joins all selected lines into a single line with spaces between them.
<C-v>selection r{char}
In visual block mode, pressing r followed by a character replaces every character in the selected rectangle with that character.
<C-v>jj$A
Combining visual block mode with $ and A lets you append text at the end of multiple lines, even when the lines have different lengths.
<C-v>selection c
In visual block mode, pressing c changes (replaces) all the text in the selected rectangle.
<C-v>jjI1. <Esc>
Visual block insert can add numbered prefixes to lines.
y$
The y$ command yanks (copies) text from the cursor position to the end of the line.
:earlier 10m
The :earlier command restores the buffer to its state at a specific time in the past.
:sort
The :sort command sorts lines in the current buffer or a specified range alphabetically.
ddp
The ddp sequence swaps the current line with the line below it.
:%s/\s\+$//
The :%s/\s\+$// command removes trailing whitespace (spaces and tabs) from every line in the file.
:m {line-number}
The :m (move) command moves the current line to after the specified line number.
<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.
:t {line-number}
The :t (copy/transfer) command duplicates the current line and places it after the specified line number.