Cut and paste
Recall the last lesson
- We reviewed the whole subject in a big way
motion
: -
Direct movement
- h j k l
-
Line movement
- First lineg g
- Last lineG
- Line nn G
-
Word movement
wbe
- wIt’s to the next one
word
Beginning of - bYes to the current
word
Beginning of - eYes to the current
word
The end of - except
word
BesidesWORD
- wIt’s to the next one
-
Beginning and end of line
- ^Is the first non empty character to the line
- 0Is the first character of the line, whether it is a space or not
- g_Is the last non empty character to the line
- $Skip to the last character of the line, even if it is a space
-
Intra line jumping and clinging
- towards
front
Jump isf - towards
after
Jump isF - towards
front
Close yest - towards
after
Close yesT
- towards
-
Full text search
- If you look for it/
- Reverse search is?
-
Text block
- {、}Move by paragraph
- (、)Move by sentence
- these
motion
FinedIt can be used together to complete the work of rapid deletion - It can also be used in the process
[count]
Double - Delete the content and put it in
""
Register - Can cooperate and repeat.
- And some of the previous commands can have a new understanding
Look back
-
Some of the original operations can be written in a new way
- D corresponding to D$
- X corresponds to DL
- X corresponds to DH
- Experience the joy of exercising your left ring finger
- Delete the content and put it in
""
Register - Then delete this thing
- Put it in the register
- I want to paste it somewhere else
- What shall I do?
About pasting
- If you paste it, you should delete it from this
d
It’s not far h d
Find the cut help file inchange.txt
- In the file
5.copying and moving text
in - Can findpPaste the corresponding command
- no
paste
p
Corresponding toput
Put it on- What do you put on it?
- hold
d
Put something in the register
Do it
-
Let’s try
- Let’s enter a line
oeasy
Then he was testeddd - This time
oeasy
This line enters the register""
Yes - thenpA moment later, there will be one
oeasy
- 9 pWill appear
9
that ‘s okoeasy
- Really!!!
- Let’s enter a line
-
But there are two of themp
- One is calledpbe supposed to
after cursor
- The other is calledPbe supposed to
before cursor
- One is calledpbe supposed to
- What do you mean?
Up and down
- Delete all firstg g d G
- Let’s adjust the ruler first
:ru
-
Then insert
1
that ‘s ok9
individual1
- 9
- iEnter insert mode
- input
1
- escReturn to normal mode
- oLine feed return
-
Then insert
1
that ‘s ok9
individual2
- beforeescEnter normal mode (to interrupt the input state)
- iEnter insert mode
- input
2
- escReturn to normal mode
-
8.
- Repeat insert 2
8
second
- Repeat insert 2
- oLine feed
- esc
-
Then try inserting again
1
that ‘s ok3
- The method is the same as above
-
Insert last line
oeasy
- Combined used dDelete him
- That is, put him in
""
In the default register
Experience up and down
- Let’s move the cursor to the second
2
that ‘s ok - pThis time
- register
""
Mediumoeasy
Will put2222222...
oflower
noodles
- useuUndo the previous operation
-
Let’s try againP, capitalized
- Let’s move the cursor to the second
2
that ‘s ok - PThis time
- register
""
Mediumoeasy
Will put2222222...
ofupper
noodles
- Let’s move the cursor to the second
- How did he know it was a business?
details
- What if there is not a whole line in the register?
- Let’s go first
:reg
Look at the register""
- Register except
oeasy
There’s another one^J
It means including line breaks - We don’t need it this timedd
-
We used$
motion
yes$
It means to the end of the line- That’s it
oeasy
Put it in the register""
- Take a look
:reg
^J
The line feed is gone!- P one!
-
Is this p also case sensitive?
around
- Move the cursor to
222222...
The first5
individual2
- thenp
- He’s right there
5
individual2
behind
Insert register contents - uCome back and put it on the second floor
5
individual2
upper - thenP
- He’s right there
5
individual2
front
insert
Routine operation
-
DW is delete word
- There is no newline character deleted here
- Note that the following spaces are also deleted
- Put them into the register together
-
Wel is the moving position
- Next word header to t
- O from the end of the next word to to
- Space to the right
- P is pasted after the cursor
Common interchange characters
- X deletes the current character
- P is pasted at the back
summary
- Our content this time is paste
- The pasted content is
:reg
Content in - Content on
""
Register -
If
:reg
One or more rows are deleted- When pasting, paste it above or below the current line
-
If
:reg
The deletion does not include line breaks- Then paste it in front of or behind the current position
-
p
-
If there are rows in the clipboard
- Then paste under the cursor
-
If there is no line in the clipboard
- Then paste after the cursor
-
-
P
-
If there are rows in the clipboard
- Then paste on the cursor
-
If there is no line in the clipboard
- Then paste in front of the cursor
-
- Case corresponds to the paste position
- With delete and paste, we can actually cut
- But if I want to copy and paste, what should I do?
- Next time
[GitHub address](https://github.com/overmind19…)
[gitee address](https://gitee.com/overmind198…)
[invitation code of Lanqiao experimental building fjwyimgb](https://www.lanqiao.cn/course…)