How do you cycle between next and previous buffers?
Use :bn (bnext) to go to the next buffer and :bp (bprevious) to go to the previous one.
category:
buffers-windows
tags:
#buffers
#cycle
#next-previous
How do you run a command across all open buffers?
Use :bufdo to execute a command in every buffer.
category:
buffers-windows
tags:
#buffers
#bufdo
#command
How do you switch to a buffer by partial name?
Use :b with a partial filename.
category:
buffers-windows
tags:
#buffers
#switch
#name
How do you switch to a buffer by its number?
Use :b followed by the buffer number.
category:
buffers-windows
tags:
#buffers
#switch
#number
How do you delete all hidden buffers in Vim?
:call DeleteHiddenBuffers()
Define a function or use a plugin.
category:
buffers-windows
tags:
#buffers
#delete
#hidden
How do you delete a specific buffer by its number?
Use :bd (bdelete) followed by the buffer number.
category:
buffers-windows
tags:
#buffers
#delete
#number
How do you yank the same text to multiple registers?
Yank the line twice into different registers.
category:
registers
tags:
#registers
#multiple
#yank
How do you yank a single word into a named register?
Use "a to specify register a, then yiw to yank the inner word.
category:
registers
tags:
#registers
#yank
#word
How do you yank lines between two marks into a register?
Set marks with ma and mb, then yank the range between them into register a using "a:'a,'by.
category:
registers
tags:
#registers
#marks
#yank
How do you yank an entire paragraph into a named register?
Use "ayip to yank the inner paragraph into register a.
category:
registers
tags:
#registers
#yank
#paragraph
How do you yank a sentence into a named register?
Use "ayis to yank the inner sentence into register a.
category:
registers
tags:
#registers
#yank
#sentence
How do you yank a visual block selection to a register?
Enter visual block mode with , select the block, then "ay to yank the block into register a.
category:
registers
tags:
#registers
#block
#yank
How do you yank the entire file contents into a register?
Go to the first line with gg, then visually select from there to the last line with VG, and yank into register a.
category:
registers
tags:
#registers
#yank
#entire-file
How do you yank an entire function body into a register?
Position cursor in a function, use VaB to visually select the block including braces, then "ay to yank into register a.
category:
registers
tags:
#registers
#yank
#function
How do you use text from one register inside a macro?
While recording macro a, paste from register b with "bp.
category:
registers
tags:
#registers
#macro
#paste
How do you use a register value in a substitute command?
In command-line mode, a inserts the contents of register a.
category:
registers
tags:
#registers
#substitute
#search
What is the unnamed register and how does it work?
The unnamed register "" is the default target for yank, delete, and change operations.
category:
registers
tags:
#registers
#unnamed
#default
How do you set the search register programmatically?
Use :let @/ = 'pattern' to set the search register directly.
category:
registers
tags:
#registers
#search
#set
What is the selection register in Vim and how do you use it?
The register represents the primary selection (middle-click paste in X11).
category:
registers
tags:
#registers
#selection
#primary
How do you set a register programmatically in Vim?
:call setreg('a', 'text')
Use setreg() to set register contents from Vimscript.
category:
registers
tags:
#registers
#setreg
#function