How do I highlight user-defined macro abbreviations in Vim?

Asked 2 years ago, Updated 2 years ago, 76 views

First of all, I'm a beginner who just started programming, so I'm sorry that this may be a wrong question.

I think I will omit the model name using typedef and using in languages such as c++, but is it possible to omit the model name as well?Also, if it is not possible, is there a plug-in that makes it be done?For example,

using ll=long long

If so, long will be colored, but ll will remain the same color as the text color, so I would like to add a color to make it stand out

c++ c vim

2022-09-30 11:49

1 Answers

  • Do you want to analyze open files so that they can be automatically highlighted from where you are using typedef or using?
  • Do you just want to add ll as a keyword in the *.c file?

I don't understand, but the latter one seems relatively easy

Make your own syntax highlights
with vim is likely to be helpful

I don't know your environment, so I can write specifically, but if it's my environment (Ubuntu), it's a *.c file
—syntax
I looked it up in and found that the model name was cType, so
~/.vim/ftplugin/c.vim
to

syntax keyword cTypell

Then ll was colored as the model name


2022-09-30 11:49

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.