VIM uses the match substitution command mate expression to implement an increment substitution

Source: Internet
Author: User

: Let n=100 | G/while/s/\d/\=n/| Let N=n+1

Before

Ten void *thread_function_1 (void *arg) {one         int i;         1 while (                 "thread 1 says hi!\n"); 15
   g_counter + = 1;                 sleep (1); +         return NULL; +  void *thread_function_2 (void *arg) {         24 int i;  While         (1)         {                 says ("Thread 2 hi!\n"),                 g_counter + = 2,                 sleep (1), and         return NULL; 31} 32< c18/>33 void *thread_function_3 (void *arg) {         1) PNS (                 "thread 3 S") Ays hi!\n ");                 G_counter + = 2;                 sleep (1);         

After

Ten void *thread_function_1 (void *arg) {one         int i;         1 while (                 "thread 1 says hi!\n"); 15
   g_counter + = 1;                 sleep (1); +         return NULL; +  void *thread_function_2 (void *arg) {         24 int i;  While         (1)         {                 says ("Thread 2 hi!\n"),                 g_counter + = 2,                 sleep (1), and         return NULL; 31} 32< c18/>33 void *thread_function_3 (void *arg) {         1) PNS (                 "thread 3 S") Ays hi!\n ");                 G_counter + = 2;                 sleep (1);         

VIM uses the match substitution command mate expression to implement an increment substitution

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.