Skip to main content
added 292 characters in body
Source Link
Ralf
  • 9.4k
  • 1
  • 13
  • 32

In step 7 you delete the text you selected in step 6, so it is moved to the unnamed register ("clipboard").

This the normal behavior of Vi(m).

If you want to copy something multiple times, you should put it into a named register, e.g. into register 'a'.

In step 3 you would use "ay and in step 7 you would use "ap.

The unnamed register still changes in step 7, but the register a can be reused.


Different approach: As Rich pointed out in a comment, it is easier to use the register "0. This register contains the text from the most recent yank command. In this case you would use "0p in steps 9 and following. (You could also use it in step 7.)


See :h registers and following

BTW: Step 4 isand 8 are not needed, after step 3 as you are already in normal mode.

In step 7 you delete the text you selected in step 6, so it is moved to the unnamed register ("clipboard").

This the normal behavior of Vi(m).

If you want to copy something multiple times, you should put it into a named register, e.g. into register 'a'.

In step 3 you would use "ay and in step 7 you would use "ap.

The unnamed register still changes in step 7, but the register a can be reused.

See :h registers

BTW: Step 4 is not needed, after step 3 you are in normal mode.

In step 7 you delete the text you selected in step 6, so it is moved to the unnamed register ("clipboard").

This the normal behavior of Vi(m).

If you want to copy something multiple times, you should put it into a named register, e.g. into register 'a'.

In step 3 you would use "ay and in step 7 you would use "ap.

The unnamed register still changes in step 7, but the register a can be reused.


Different approach: As Rich pointed out in a comment, it is easier to use the register "0. This register contains the text from the most recent yank command. In this case you would use "0p in steps 9 and following. (You could also use it in step 7.)


See :h registers and following

BTW: Step 4 and 8 are not needed as you are already in normal mode.

Source Link
Ralf
  • 9.4k
  • 1
  • 13
  • 32

In step 7 you delete the text you selected in step 6, so it is moved to the unnamed register ("clipboard").

This the normal behavior of Vi(m).

If you want to copy something multiple times, you should put it into a named register, e.g. into register 'a'.

In step 3 you would use "ay and in step 7 you would use "ap.

The unnamed register still changes in step 7, but the register a can be reused.

See :h registers

BTW: Step 4 is not needed, after step 3 you are in normal mode.