I am not disgusted with the Linux system, but I am disgusted with complicated command operations. I feel that as a programmer, I should focus on the Code architecture and writing, rather than memorizing these commands.
I wrote this article because I was configuring the source of an Ubuntu server some time ago. However, for the command line-only interface, I had to take a good look at these commands. (There may be a lot of cases. Isn't the blogger having file ing ?, Well, I cannot set up a samba on a server to configure a source file, right ?, So remember some basic commands)
For example, if you want to copy data from 1st rows to 5th rows
Move the cursor to any position in line 5th and enter Ma
Move the cursor to any position in row 1st and enter y 'a (this must be put in single quotation marks, otherwise it will enter the "insert" status.
Move the cursor to the row to be copied, enter P, and copy the input capital P before the row
Or
First move the cursor to the second line, and then D4 (a total of 1 ~ is copied here ~ Five rows. The trick is to use the DELETE command. In fact, here is to delete 1 ~ Five rows. After the deletion is complete, you must use the U command to cancel the deletion. However, this 1 ~ Five rows, so P can be used for copying)
P
Move the cursor to the position to be pasted.
P
Or
Move the cursor to 9th rows
Shift v
Move the cursor to the second line.
CTRL C
Move the cursor to the second line.
P
Or
The nyy command is used to copy n rows starting from the row where the cursor is located. Generally, there are many numbers that are very intuitive within five rows.
I prefer the third method, which is simple and intuitive, and uses Ctrl + C, a command that is almost synonymous with replication.
Note:
Do not copy multiple rows at the same time, but only recognize the first time. My method is to use YY to copy the same (that is, cancel copying multiple rows );
Query the row number. In non-editable mode, enter: set number.
Vim insert other file content
Insert R/path/filename in command mode