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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:10:29+00:00 2026-06-11T07:10:29+00:00

I have already asked a question about syntax highlighting, but this seems (to me)

  • 0

I have already asked a question about syntax highlighting, but this seems (to me) to be different and I could not find the answer in Stackoverflow.

1) Suppose I want to build a Todo list in Vim. This Todo list should have the task + 3 differently highlighted “regions” :

  • the task (e.g. wash the car), always at the beginning, should remain plain non-highlighted text
  • the person who has to do that thing – myself – preceded by @. I want it to be highlighted in (e.g.) green
  • the category of the task – here Household – preceded by §. I want it to be in yellow
  • the importance of the task – here Later -, preceded by # which I want to be red.

Thus the result should be (in one line) :

Wash the car @myself (green) §Household (yellow) #Later (red)

I have tried to define a first region starting with @, ending with §, a second starting with § and ending with #, and a third starting with # and ending with $.

:syntax region xPers start ='@' end='§'
hi xPers ctermfg=DarkGreen
:syntax region xProject start ='§' end='#'
hi xProject ctermfg=DarkYellow
:syntax region xImportance start ='#' end='$'
hi xImportance ctermfg=DarkRed

To no avail… All the indications that comes after the task itself, starting with @ are highlighted in green.

What are my (unforgivable) errors ?

2) To make things more complicated, I might write tasks down in a disorderly way, and write :

Wash the car @myself (green) #Later (red) §Household (yellow)

How should the syntax be defined to take this lack of discipline in consideration, and keep the colors right ?

Thanks in advance

  • 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-11T07:10:31+00:00Added an answer on June 11, 2026 at 7:10 am

    You might want to take a look at Todo.txt and the vim syntax file for Todo.txt. However, as per your question, it seems like you want to end with a space instead of a symbol. So you could do this:

    syntax region xPers start ='@' end=' '
    hi xPers ctermfg=DarkGreen
    syntax region xProject start ='§' end=' '
    hi xProject ctermfg=DarkYellow
    syntax region xImportance start ='#' end=' '
    hi xImportance ctermfg=DarkRed
    

    however this won’t account for the end of a line. So you could put an “or” statement in there for the end of the line like this:

    syntax region xPers start ='@' end=' \|$'
    hi xPers ctermfg=DarkGreen
    syntax region xProject start ='§' end=' \|$'
    hi xProject ctermfg=DarkYellow
    syntax region xImportance start ='#' end=' \|$'
    hi xImportance ctermfg=DarkRed
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have already asked this question on asp.net forum, could not find any satisfactory
I have already asked about this for android, but I will broaden the question
I have already asked a question about this, but the problems keeps on hitting
I already asked a question about this yesterday, but now I have another :)
I have tried looking though several of the already asked question about this topic
I am sorry I have already asked this question on Superuser, but nobody answers
I have already asked this question on SuperUser but it was suggested there that
I was about to ask this question...but since it has already asked I will
Yes, I have already asked this question, but the problem is much more specific.
Probably someone has already asked this question but I'm not sure what I'm looking

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.