=================================linux VIM Replication ============================
1. Copy
1) Single-line copy
In command mode, move the cursor to the line that will be copied, and press "yy" to copy;
2) Multi-line replication
In command mode, move the cursor to the first line that will be copied, press "Nyy" to copy n rows, where n is 1, 2, 3 ...
2. Paste
In command mode, move the cursor to the line you want to paste, and press "P" to paste
=================================linux Vim Search ============================
We use the Samba configuration file as an example to search for a user string.
Vim/etc/samba/smb.conf
Open smb.conf
Command mode, enter/user
/string or character to search for
After you press ENTER, you can see that VIM has moved the cursor to the word prompt and highlighted the matching string (vi is not highlighted because it has no color)
How do I see the next match? Press N (lowercase n)
So how do I jump to the previous match? Press N (uppercase N).
You can press the CAPS LOCK key to toggle the case, or you can press SHIFT + N in the lowercase state
What if we want to search from the end of the file to the beginning?
Use the? user
? The string or character to search for
Last question, after searching, we open other files, found also highlighted, how to turn off highlighting?
Command mode, enter: Nohlsearch
Ps:nohlsearch Yes (no highlight search abbreviation)
You can also: set Nohlsearch
Of course, it can be abbreviated.
Noh or set Noh
Linux simple operation copy vim inside the search