vim usage collection

1. Copy and paste the entire line

1.1. yy is to copy the line where the cursor is, and nyy is to copy the line including the cursor and the n-1 lines down, a total of n lines.
1.2. p is to paste the copied data in the next line of the line where the cursor is. The uppercase P is pasted on the line above the line where the cursor is located.

2. Copy and paste some characters

There are some shortcut keys that can help us copy certain words in a row of data
as follows:

  • yw copy a word (including whitespace characters after the word)
  • 4yl Copy the character under the current cursor and the next three characters, a total of four characters
  • 4yh Copy the four characters before the cursor (not including the character where the cursor is currently located)

Guess you like

Origin blog.csdn.net/weixin_44231554/article/details/131668430