VIM notes -- ignore case sensitivity when searching text & Highlight search text

Source: Internet
Author: User
VIM note-ignore case sensitivity & amp; highlight when searching text search text ignore case sensitivity/searchword \ c or modify the settings: setignorecase or: setic highlight: sethlsearch cancel highlight: how does setnohlsearch search find rows that contain two search characters at the same time? Findi... VIM note-ignore case sensitivity when searching text & Highlight search text ignore case sensitivity/searchword \ c or modify the settings: set ignorecase or: set ic highlight: set hlsearch unhighlighted: set nohlsearch how to find the rows that contain two search characters at the same time: Finding two words in either orderEdit Finding two words in either order sectionEdit You can search for a line that contains two words, in any order. for example, the following pattern finds all lines that contain both "red" and "blue", in any order :. * red \&. * blue In a pattern, \ & separates alternates, each of which has to match at the same position. the two alternates in this example are :. * red (will match all characters from the beginning of a line to the end of the last "red"); and. * blue (will match all characters from the beginning of a line to the end of the last "blue "). A line which contains both "red" and "blue" will match both alternates, starting at the beginning of the line. the pattern. * red \&. * blue finds the last alternate (but only if all alternates match at the same position), so if you are highlighting matches, you will see text matched. * blue highlighted. an alternative procedure is to use a pattern that explicitly finds "red" followed by "blue", or "blue" followed by "red": \ (red. * blue \) \ | \ (blue. * red \) To search for lines that contain only the whole words "red" and "blue", in either order, use one of the following patterns :. *\ \&.*\ \(\ .*\ \) \ | \(\ .*\ \)
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.