Skip to main content
Known Participant
April 9, 2019
Answered

Files with the extension ".inc": Syntax Highlighting and Code Formatting like ".php"?

  • April 9, 2019
  • 3 replies
  • 1844 views

Hi.

For my PHP includes I use the file extension ".inc".

Is it possible to configure DW in a way, that he uses the same syntax highlighting and code formatting rules as for files with the extension ".php"?

Thanks.

This topic has been closed for replies.
Correct answer Jon Fritz

The old method will work for you then (I also use CC 2015 and have used it in the past) as shown here:

The file path for your personal config folder should be...

~/Library/Application Support/Adobe/Dreamweaver CC 2015/your language/Configuration

Modifying the Extensions.txt by adding INC to the PHP line, then the MMDocumentTypes.xml (adding inc twice to the php section), then removing the .inc from the Open in Code View under Preferences > File Types/Editors will do the trick.

3 replies

Legend
April 9, 2019

For latest CC 2019 this should work:

Copy this in a text file and name it main.js

define(function (require, exports, module) {

    var LanguageManager = brackets.getModule("language/LanguageManager");

    var language = LanguageManager.getLanguage("php");

    language.addFileExtension("inc");

});

You then need to navigate to your Brackets extenions folder, you've NOT stated your OS, this Is an example of the path on windows:

C:\Users\username\AppData\Roaming\Adobe\Dreamweaver CC 2019\en_US\Configuration\Brackets\extensions\user\

Create a folder inside the 'user' directory named something like inc_files and copy the main.js file you created into it.

Restart Dreamweaver if already running.

Paul-M - Community Expert
Known Participant
April 9, 2019

Thanks for your hints.

I use DW15 on macOS.

May be I will use DW19 in the future again, so my question refers mainly to DW15 but I'm intereste as well in solutions for DW19.

Jon Fritz
Community Expert
Jon FritzCommunity ExpertCorrect answer
Community Expert
April 9, 2019

The old method will work for you then (I also use CC 2015 and have used it in the past) as shown here:

The file path for your personal config folder should be...

~/Library/Application Support/Adobe/Dreamweaver CC 2015/your language/Configuration

Modifying the Extensions.txt by adding INC to the PHP line, then the MMDocumentTypes.xml (adding inc twice to the php section), then removing the .inc from the Open in Code View under Preferences > File Types/Editors will do the trick.

HARSHIKA_VERMA
Community Manager
Community Manager
April 9, 2019

Hi Mistershortcut,

Thank you for coming up on the forum with your question, as per your description you are trying to configure Dreamweaver in a way so that you can use the same syntax highlighting and code formatting for files with the .php extension.

In addition to what Ben has suggested if you want to customize the colors of your code elements in Dreamweaver, please check this link:-

Learn how you can customize the colors of your code elements in Dreamweaver.

If you want to set the coding preferences in Dreamweaver like code themes, format and code rewriting you can check this link as well:-How to set coding preferences in Dreamweaver

Please check if this helps you and let us know.

Regards,

Harshika

Known Participant
April 9, 2019

Thanks Harshika.

But I know how to customize an existing code library for colors or formatting.

What I'm looking for is way how I can make DW treat files with ".inc" equally to ".php", regarding color and formatting.

Legend
April 9, 2019

What version of Dreamweaver are we talking about?

Paul-M - Community Expert
BenPleysier
Community Expert
Community Expert
April 9, 2019

I tend to name my include files as myfile.inc.php

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Known Participant
April 9, 2019

Yes. But I'm looking for that, what I described.