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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:58:07+00:00 2026-06-16T00:58:07+00:00

I have a syntaxfile for highlighting awk embedded in bash script: syn include @AWKScript

  • 0

I have a syntaxfile for highlighting awk embedded in bash script:

syn include @AWKScript syntax/awk.vim
syn region AWKScriptCode matchgroup=AWKCommand
    \ start=+[=\\]\@<!'+ skip=+\\'+ end=+'+ contains @AWKScript contained
syn region AWKScriptEmbedded matchgroup=AWKCommand
    \ start=+\<\(g\?awk\|\$AWK\)\>+ skip=+\\$+ end=+[=\\]\@<!'+me=e-1 
    \ contains=@shIdList,@shExprList2 nextgroup=AWKScriptCode
syn cluster shCommandSubList add=AWKScriptEmbedded
hi def link AWKCommand Type

The problem is with this section:

start=+\<\(g\?awk\|\$AWK\)\>+

It works fine for awk and gawk, but not for $AWK. How can I add a rule to match $AWK as a starting pattern for the AWKScriptEmbedded region?

  • 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-16T00:58:08+00:00Added an answer on June 16, 2026 at 12:58 am

    The problem is that the $AWK is already highlighted by the shDerefSimple syntax group, so your new region isn’t applied. Split the syntax definition into two parts and add the containedin= for the latter:

    syn region AWKScriptEmbedded matchgroup=AWKCommand
        \ start=+\<g\?awk\>+ skip=+\\$+ end=+[=\\]\@<!'+me=e-1
        \ contains=@shIdList,@shExprList2 nextgroup=AWKScriptCode
    syn region AWKScriptEmbedded matchgroup=AWKCommand
        \ start=+\$AWK\>+ skip=+\\$+ end=+[=\\]\@<!'+me=e-1
        \ contains=@shIdList,@shExprList2 containedin=shDerefSimple nextgroup=AWKScriptCode
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to edit the python.vim syntax file to duplicate the syntax highlighting for
I have access to a syntax highlighting program for an internal-only language. Is there
I decide to learn more about vim and its syntax highlighting. Using examples for
I have a very simple Vim syntax file for personal notes. I would like
I currently have a syntax file that parses a log file, very similar to
So I have some custom vi coloring in a syntax file. This works perfectly
I'm creating a custom syntax file for vim, and to make the code easier
Suppose I have a file opened with the C syntax FILE* fp = fopen(whatever.txt,
Have a look at this code: #include <iostream> using namespace std; int main() {
I'd like to implement a syntax file for vim that hides certain characters in

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.