0

What are the following two components that I need to target with syntax highlighting/rules?

enter image description here

  1. The first one is the int (or more generall, any storage class) that I want to colorize. If currently have the following 'rule' in my c.vim file, but it doesn't seem to do anything:

    hi StorageClass ctermfg=21 ctermbg=NONE cterm=bold guifg=#0000ff guibg=NONE gui=bold
    
  2. Why aren't the closing braces recognized (it works with (...) but not {...})? How can I modify this rule to fix it?

8
  • 1
    Hey David, you need to add int to StorageClass using syn keyword StorageClass int. That adds the word int to the keyword group StorageClass. You can then define the highlighting parameters for that group like you have done. As for your second question, I'm not sure. – Vee Jan 19 at 19:22
  • @Vee just tried that but doesn't seem to work in my case...any idea? – David542 Jan 19 at 19:48
  • Is syn keyword StorageClass int located above the highlight statement in c.vim? – Vee Jan 19 at 20:07
  • 1
    @Vee actually, the whole thing was solved by putting it in after/syntax instead of syntax. Thanks for the help! – David542 Jan 19 at 20:40
  • 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.