Vim word highlighting

Source: Internet
Author: User

Vim word highlighting

SourceInsight supports word highlighting. I always think it is easier to read code. Today, I checked whether vim has related plug-ins. It is found that there are similar functions. Www.2cto.com http://www.vim.org/scripts/script.php? Script_id = 1, 1238
To sum up the related usage, you need to find more information when using it later. Usage of highlight: Normal mode: In Normal mode of Vim, \ m is used to make the word coloring at the cursor \ n so that the color of the original word is not colored \ r input \ r and then input a regular expression, you can highlight matching related words on the example: \ m demo -- move the cursor to the_uri of 37 rows and input \ m. The screen is as follows: we can see that all a_uris show the same color. \ N demo -- move the cursor to line 37 a_uri and input \ n. The screen is as follows:
We can see that all the_uri colors are canceled. Www.2cto.com \ r demo -- enter \ r first, and then enter a _. *. The display screen is as follows:
As you can see, the contents that match the regular expression a _. * are displayed in color. Cancel the \ r color display, as long as \ n is input. Virtual mode: the usage of Visual mode is the same as that of Normal mode. Not detailed. Command Line: mark. vim also supports entering a regular expression in Command line to display the color of the matching content. In Command line, use the: Mark regexp format to Mark the content matched by the regular expression. The effect is the same as that of \ r. The display result of Mark a _. * is the same as that of \ r.
 
Enter Mark a _. * again to cancel the highlight. Input: Mark Other_regexp other regular expressions can be used to display highlighted colors at the same time. Use: Mark to cancel all highlighted results. Www.2cto.com Note: The highlighted and unhighlighted functions can be displayed in each mode. For example, if you use \ r and input a _. * to highlight the content that matches a _. *, you can enter: Mark a _. * to cancel the highlight of \ r. Search direction: Use \ * to obtain the next highlighted word, and use \ # To obtain the previous highlighted word. NOTE: If there are multiple highlighted words. \ * And \ # are searched based on the results of the previous highlighted word in the record. For example, if the last highlighted word is AAA and the highlighted word BBB is used, if the cursor is not in AAA or BBB, \ * indicates the previous AAA, \ # indicates the next AAA. If the cursor is at BBB at this time, \ * automatically matches BBB, indicating the previous BBB. \ # indicates the next BBB, mark. the vim plug-in can only mark up to 6 phrases. If there are more than 6 phrases, the color of the phrase marked first disappears. When six colors have been marked: www.2cto.com, if the \ m operation is performed on the 46-row memset. The uri_parse_state color marked first is canceled. As shown in: the following links are enhancements to the above plug-in: http://www.vim.org/scripts/script.php? Script_id = 1, 2666
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.