Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6979759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:55:37+00:00 2026-05-27T17:55:37+00:00

I want to highlight variables in a C/C++ file . such as: int num;//

  • 0

I want to highlight variables in a C/C++ file .
such as:

    int num;// Highlighted  num
    char str;// Highlighted str

    struct data
    {
     int year;
     int month;
     };
     struct data *p,time;// Highlighted  p  time
     ..........

How to highlight variables as given above (num ,str, p,time…..)

I know we can modify syntax\c.vim to reach that,but how to write the syntax?

Is there any other solution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:55:38+00:00Added an answer on May 27, 2026 at 5:55 pm

    In general, you need to do two things:

    1. Generate tags using ctags;
    2. Generate syntax file using resulting tags file.

    Now some details.

    There are plugins to help you. Firstly, plugin Indexer automatically generates tags for a whole project and keeps tags up-to-date. (i’m author of this plugin, so, if you have any problems using it, feel free to ask me)

    And secondly, there’s plugin TagHighlight to extra highlights variables, enums, typedefs, etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to highlight C/C++/Java/C# etc source codes in my website. How can I
I have a table that i want to highlight during onmouseover/onmouseout. I already know
When comparing similar lines, I want to highlight the differences on the same line:
I have a longer text and some keywords. I want to highlight these keywords
I want to make a uiview that can be aware of highlight status, like
I'm trying to highlight the search results but I want to include the surrounding
I want to link to bookmark on a page (mysite.com/mypage.htm#bookmark) AND visually highlight the
I want to, when the user selects a date, highlight the following 11 days.
I'm trying to find a Java library to highlight code. I don't want to
I have the following XML <title> This is a <highlight>test</highlight> thanks. </title> and want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.