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 7961867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:10:15+00:00 2026-06-04T05:10:15+00:00

Whenever I’m typing programming keywords in vim they get specific colors. I’d like to

  • 0

Whenever I’m typing programming keywords in vim they get specific colors.

I’d like to create my own.

How can I color text with specified color?

I tried to find the answer but haven’t found it yet

  • 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-06-04T05:10:17+00:00Added an answer on June 4, 2026 at 5:10 am

    to extend C/CPP syntax (and that can apply to any language, just check for the already existing names, like Constant here) :

    in your ~/.vimrc

    if has("autocmd")
        augroup filetypedetect
                au BufNewFile,BufRead *.myext    setf mysyntax
        augroup END
    endif
    

    and in your ~/.vim/syntax/mysyntax.vim

    runtime! syntax/cpp.vim
    
    syn keyword myConstant foo bar foobar quack
    hi def link myConstant Constant
    

    to create new keywords from scratch :

    syn match myKeyWord "foobar" contained
    hi kwRed  term=standout ctermfg=12 guifg=Red
    hi def link  myKeyWord  kwRed
    

    and you can call that with filetypedetect, or directly in your .vimrc

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

Sidebar

Related Questions

Whenever I have to work with topics like file-handling or socket-programming, I have to
Whenever I use Vim with Ruby files, I get nice coloring and automatic indention
Whenever I output a particular pointer address to std::cout , I get a crash:
Whenever I run my android application I get an exception: 05-07 12:03:55.356: E/AndroidRuntime(589): FATAL
Whenever I create a Temporary file in C++ Native WinAPI, the HANDLE returned is
Whenever I try to post to an https endpoint, I get a javax.net.ssl.SSLException: java.lang.NullPointerException
Whenever there is dilemma to do a particular task, which can be accomplished either
Whenever I create an html page I have to replace all the special characters
whenever i try to run something like the following, firebug tells me that "markers
Whenever I do typedef std::vector< SomeType >::iterator I get the error: error: wrong number

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.