Linux Administration
medium

Questão de Linux Administration #019e3987

Enunciado da Questão
Linux Administration
#vi
#vim
#numeric-prefix
#cursor-movement
#yank
Médio

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.

Correta
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.

Explicação Oficial / Explicações da Comunidade

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.