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

Contributor ,
Apr 09, 2019 Apr 09, 2019

Copy link to clipboard

Copied

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.

Views

872

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , Apr 09, 2019 Apr 09, 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.

Likes

Translate

Translate
Adobe Community Professional ,
Apr 09, 2019 Apr 09, 2019

Copy link to clipboard

Copied

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

Wappler, the only real Dreamweaver alternative.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 09, 2019 Apr 09, 2019

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 09, 2019 Apr 09, 2019

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 09, 2019 Apr 09, 2019

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 09, 2019 Apr 09, 2019

Copy link to clipboard

Copied

What version of Dreamweaver are we talking about?

Paul-M, ACP

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 09, 2019 Apr 09, 2019

Copy link to clipboard

Copied

I'm not sure if this works in the latest versions, but this used to be the way to add new extensions to DW...

Add or edit recognized file extensions in Dreamweaver

EDIT: I just tested in the latest version and the 3-step, old method at the top of the article still works, though the path to the personal configuration folder is slightly different.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 09, 2019 Apr 09, 2019

Copy link to clipboard

Copied

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, ACP

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 09, 2019 Apr 09, 2019

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 09, 2019 Apr 09, 2019

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 09, 2019 Apr 09, 2019

Copy link to clipboard

Copied

@Jon

Your explanation was so helpful. It worked instantly.

How nice to view "*.inc" in that way! Great!

@Paul-M

Thank a lot too.

I will note that steps to my todo for DW 2019.

Have a nice day everyone.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 11, 2019 Apr 11, 2019

Copy link to clipboard

Copied

LATEST

you are welcome

Paul-M, ACP

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines