Copy and cut in the vi editor in Linux, linuxvi
In Linux, the vi editor implements simple copy and paste functions.
If you want to paste the third line of content in the file to row 3:
1. Enter your file (in command mode, not edit mode)
2. Move your cursor to the beginning of your third line (with the direction key)
3. Press v (you find that you have switched to visual mode) and press the arrow key to select the desired content.
4. Press y and move the cursor to the end of the row 14th.
5. Press p. Complete
This method can be used to paste multiple rows-> copy
If you want to cut-> copy, it will be simpler (it can only be used for single rows)
1. Enter your file (in command mode, not edit mode)
2. Move your cursor to the beginning of your third line (with the direction key)
3. Double-click d (the third line is missing)
4. move the cursor to the end of the row 14th and press p.
Under the GUI: you can press I to enter the insert mode. Drag the mouse to select the content to be pasted, move the cursor to the position to be pasted, and press the middle mouse button (two keys can be clicked simultaneously ).
In a plain text terminal:
Select a text block and use v
Copy the selected block to the buffer, and use y
Copy the entire row, using yy
Open the second file in the same editing window and use: sp [filename]
Switch between multiple editing files, with ^ ww
Cut block, with d
Use dd to cut the entire row
Paste the content in the buffer, and use p
Add a number to the front of the command to indicate the number of repetitions, and add a letter to indicate the name of the buffer used.
For help, use: help [content or command].
END
How Can I copy the entire line of n in the linux Vi editor so that it can be pasted into the text?
1. Enter your file (in command mode, not edit mode)
2. Move your cursor to the beginning of your third line (with the direction key)
3. Press v (you find that you have switched to visual mode) and press the arrow key to select the desired content.
4. Press y and move the cursor to the end of the row 14th.
5. Press p. Complete
This method can be used to paste multiple rows-> copy ~!
If you want to cut-> copy, it will be simpler (it can only be used for single rows)
1. Enter your file (in command mode, not edit mode)
2. Move your cursor to the beginning of your third line (with the direction key)
3. Double-click d (the third line is missing)
4. move the cursor to the end of the row 14th and press p.
How Can I copy the entire line of n in the linux Vi editor so that it can be pasted into the text?
1. Enter your file (in command mode, not edit mode)
2. Move your cursor to the beginning of your third line (with the direction key)
3. Press v (you find that you have switched to visual mode) and press the arrow key to select the desired content.
4. Press y and move the cursor to the end of the row 14th.
5. Press p. Complete
This method can be used to paste multiple rows-> copy ~!
If you want to cut-> copy, it will be simpler (it can only be used for single rows)
1. Enter your file (in command mode, not edit mode)
2. Move your cursor to the beginning of your third line (with the direction key)
3. Double-click d (the third line is missing)
4. move the cursor to the end of the row 14th and press p.