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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:08:42+00:00 2026-06-15T11:08:42+00:00

Consider a simple text markup language where _underscores denote italics_ and *astrisks denote bold*

  • 0

Consider a simple text markup language where _underscores denote italics_ and *astrisks denote bold*.

In an imaginary vim syntax file you might have

syntax region italic start='_' end='_' keepend
syntax region bold start='*' end='*' keepend
highlight italic cterm=italic
highlight bold cterm=bold

(yes I know that it’s \*, I left it as * for clarity.)

The problem here is _strings like *this*_. Even if your terminal supports italicBold fonts you only get one at a time in vim.

What I really want to do is this:

highlight italic cterm+=italic
highlight bold cterm+=bold

(term and guiterm omitted for clarity.)

It’s possible to work around this with contained italicBold and boldItalic regions that both set cterm=bold,italic, but things get messy when you want to include underline and everything gets out of hand entirely when you have a red region and a blue region and you wind up with

syntax region red ... contains=italicRed,boldRed,underlineRed
syntax region italicRed ... contains=italicBoldRed,italicUnderlineRed
syntax region italicBoldRed ... contains=italicBoldUnderlineRed
.
.
.

highlight red ctermfg=red
highlight italicRed cterm=italic ctermfg=red
highlight italicBoldRed cterm=italic,bold ctermfg=red
.
.
.

ad inifinitum.

And the kicker is that really I don’t want to hard code the color to red. I’d prefer to

highlight link red Statement

and then have italicRed use the same highlight definition as red but add the italic setting.

There’s got to be an easier way to do this. Any suggestions?

  • 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-15T11:08:43+00:00Added an answer on June 15, 2026 at 11:08 am

    No. All syntax plugins that I have seen so far use the workaround you describe.

    Why doesn’t offer Vim something better? (I had once also wished for the possibility to overlay colors, i.e. when a light yellow background is on top of light gray, it becomes dark yellow.) With high- and low-color terminals and the GUI, this is difficult to implement (anyone like a challenge?), and syntax highlighting is first and foremost for a few common programming constructs (comments, statements, identifiers, etc.), not the elaborate markup you have in mind.

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

Sidebar

Related Questions

Consider a simple JS event of document.getElementsByClassName('test')[0].onclick=function(){ document.getElementsByClassName('test')[0].innerHTML = 'New Text'; } How can
Consider this simple markup: <body> <div style=border: 2px solid navy; position:absolute; width:100%; height:100%> </div>
Consider this simple example; <?php $text = test; ?> <script type=text/javascript defer=defer> var test;
Consider the following simple html page markup: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
Consider a product where changes a client is making to a text file are
Consider this simple loop: for f in *.{text,txt}; do echo $f; done I want
Consider this simple example code: <form name=text id=frm1 method=post> <input type=checkbox name=name[] value=1000> Chk1<br>
Let's consider this sample example text file: Level: 1 Level: 1 Level: 2 Level:
this is a simple query about the searching in vim editor. consider that i
Please consider this simple example. I can't get the text of the state element

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.