Linux simple operation copy vim inside the search

Source: Internet
Author: User

=================================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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.