Vi editor paste copy cut function under Linux

  
        

If you want to paste the third line of the file into the fifteenth line:

1. Enter your file, (in command mode, not edit mode)

2 Move your cursor to the beginning of your third line (with the arrow keys)

3, press v, (you find that you switch to visual mode), press the arrow keys, know that you want to select What you want

4. Press y and move the cursor to the end of the fourteenth line.

5.Press p. Finish

This method can be used for multi-line pasting -> copy

If you want to cut -> copy it is even simpler (only for single line)

1. Enter your file, (in command mode, not edit mode)

2. Move your cursor to the beginning of your third line (with the arrow keys)

3. Press twice (discover that the third line is missing)

4, then move the cursor to the end of the fourteenth line and press p.

Under the GUI: Press i to enter the insert mode, use the mouse to drag and select the content to be pasted, move the cursor to the place to be pasted, and press the middle mouse button (two-button mouse can press the left and right buttons at the same time).

Under plain text terminal:

Select the text block, use v

to copy the selected block to the buffer, and use y

to copy the entire line , use yy

to open the second file in the same edit window, use: sp [filename]

to switch between multiple edit files, use ^ww

Cut the block, use d

to cut the entire line with dd

Paste the contents of the buffer, use the p

command to add a number to indicate the number of repetitions, plus the letters to indicate the use The name of the buffer.

Get help with: help [content or command]
END

Copyright © Windows knowledge All Rights Reserved