How do you yank lines between two marks into a register?
"a:'a,'by
Set marks with ma and mb, then yank the range between them into register a using "a:'a,'by.
2277 results for "@a"
"a:'a,'by
Set marks with ma and mb, then yank the range between them into register a using "a:'a,'by.
:let @a = toupper(@a)
Use Vimscript functions toupper() or tolower() with :let @a = toupper(@a) to convert the case of the entire register contents.
:let @a='<C-r>a'
Paste the macro register contents with :let @a=' followed by a to insert the current contents, edit them, and close the quote.
:call setreg('a', @a, 'v') then "ap
Use setreg() to change register a to characterwise mode (v), then paste.
:%normal A;
Use :%normal followed by normal mode keystrokes.
50@a
Prefix the macro playback command with a count.
:%s/<C-r>a/replacement/g
In command-line mode, a inserts the contents of register a.
qaI<C-r>a<Esc>jq
Record a macro that inserts the contents of register a at the start of each line using a in insert mode, then moves down.
qaI"<Esc>A",<Esc>jq
Record a macro that wraps each line in quotes and adds a trailing comma.
qa*Ncgn<C-r>=newName\n<Esc>q
Record a macro using * to search for the word under cursor, cgn to change the next match, type the new name.
qa80|i\n<Esc>jq
Record a macro that moves to column 80 using 80 , inserts a newline, and moves to the next line.
:put a
The :put a command pastes register a on a new line below the cursor.
qaciWmyFunc(<C-r>")<Esc>q
Record a macro that changes the inner word, types the function name with opening paren, pastes the original word from the register, and closes the paren.
"a]p
Use ]p after specifying a register to paste with adjusted indentation.
:echo getreg('a')
Use getreg('a') to get the contents of register a as a string.
:let @a = 'hello world'
Use :let @a = 'text' to set register a to any string.
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.
/<C-r>a
While in the search prompt (/), press a to insert the contents of register a.
v'a
Press v for visual mode, then 'a to extend the selection to mark a.
qaYp<C-a>q
Record a macro that yanks the current line, pastes it below, and increments the number with .