How do I record a macro to wrap each line in HTML tags?
qaI<li><Esc>A</li><Esc>jq
This macro wraps each line in tags by inserting the opening tag at the start and appending the closing tag at the end.
qaI<li><Esc>A</li><Esc>jq
This macro wraps each line in tags by inserting the opening tag at the start and appending the closing tag at the end.
qaI"<Esc>A": "",<Esc>jq
This macro transforms a plain word into a JSON key-value pair format, useful for converting lists of field names into JSON structure.
qaciw"<C-r>""<Esc>wq
This macro wraps the current word in double quotes by changing the word, inserting quotes around the original content, and moving to the next word.
qaA;<Esc>jq
This macro appends a semicolon to the current line and moves down, ready to repeat.
qaI// <Esc>jq
This macro adds a // comment prefix to the beginning of the current line and moves down.
qa I1. <Esc>j q
This simple macro inserts a list number prefix at the beginning of each line.
<C-v>u{code} in insert mode
In insert mode, u followed by a 4-digit hex code inserts the Unicode character at that code point.
]p
The ]p command pastes text and adjusts its indentation to match the current line.
ciw + new text + Esc, then n.
The ciw command followed by new text, combined with and .
ci`
The ` ci ` command changes the text inside backtick delimiters.
V select then :norm A text
Selecting lines and running :norm A text appends the same text to the end of every selected line.
cs"' (change), ds" (delete), ys iw" (add)
The vim-surround plugin by Tim Pope adds commands for working with surrounding characters like quotes, brackets, and tags.
Plug 'tpope/vim-repeat'
vim-repeat by Tim Pope extends the .
:%S/old/new/g (vim-abolish)
vim-abolish by Tim Pope provides :%S (Subvert), a substitute command that preserves the case pattern of the original text.
gcc (toggle line), gc{motion} (toggle range)
vim-commentary by Tim Pope provides a simple way to toggle comments.
let mapleader = " "
The leader key is a prefix for custom mappings.
:diffthis in both windows
The :diffthis command enables diff mode for the current buffer.
"+y and "+p
The "+ register is linked to the system clipboard.
"1p through "9p
Registers 1-9 contain the last 9 deletions or changes that are at least one line long.
".
The .