Linux Administration
medium

Pregunta de Linux Administration #019e3987

Enunciado de la Pregunta
Linux Administration
#vi
#vim
#numeric-prefix
#cursor-movement
#yank
Medio

In the vi editor, how can commands such as moving the cursor or copying lines into the buffer be issued multiple times or applied to multiple rows?

A

By using the command :repeat followed by the number and the command.

B

By specifying the number right in front of a command such as 4l or 2yj.

Correcto
C

By selecting all affected lines using the shift and cursor keys before applying the command.

D

By issuing a command such as :set repetition=4 which repeats every subsequent command 4 times.

Explicación Oficial / Explicaciones de la Comunidad

In the vi editor, commands can be repeated or applied to multiple lines by prefixing the command with a number. For example, 4l moves the cursor four characters to the right, and 2yj yanks two lines (the current line and the next) into the buffer. This numeric prefix is a fundamental vi feature that allows efficient repetition of movement, deletion, yanking, and other operations.