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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:10:09+00:00 2026-06-05T00:10:09+00:00

I want to create vim syntax highlighting file for custom programming language. Namely C/AL

  • 0

I want to create vim syntax highlighting file for custom programming language. Namely C/AL which is internal for Dynamics NAV system.

The issue is that it’s impossible to detect via file extension. Historically C/AL uses *.TXT files. It also not good to highlight all *.TXT files, since some of them might contain C/AL code.

I know that VIM is able to detect language not only by extension, but also by file content. And I have found some examples in official manual. However it states I can use either first approach, or second.

Is it possible to combine them in one go? Where I can find an examples of such behavior?

Thank you 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-05T00:10:10+00:00Added an answer on June 5, 2026 at 12:10 am

    You can use getline to refine your detection based on file contents. For example, this detects XML in .tmp files:

    autocmd! BufNewFile,BufRead *.tmp
        \ if getline(1) =~ '<?\s*xml.*?>' |
        \     setfiletype xml |
        \ endif
    

    Another approach is to add a modeline to each C/AL file.

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

Sidebar

Related Questions

I'm trying to create a syntax file and I want to create some keyword
This is a follow-up from VIM: simple steps to create syntax highlight file -
In vim, I want to create a new command that takes a file-name as
I want create module which update list of usb devices automatically (not only mass
I have C# Dictionary and I want create a .csv file from it. For
I want to create a new application (which I will sell) that uses web
I want to fold function definitions in python code using Vim syntax based folding.
I want create a DataSet class which is basically a list of samples. But
i want create XML file here is my following code String fileName = jasstech.xml;
I want create a complex jrxml file to create PDF. I want to put

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.