How to display certain file types with a particular grammar in a specific project?


#1

In a specific project, I would like to be able to display certain file types (for example, .txt files) with a particular grammar (for example, source.cpp) without having to select each time manually file by file after opening them.

As I can’t edit the main config.cson to do this (it’s only for a specific project, not for a general use as described in Customizing Language Recognition), I have tried to use the project-manager package by setting a dedicated project.cson file, but it seems that it’s not functional at the moment.

Would someone have other options to consider in order to achieve this kind of use?


#2

The file-types package expands the custom language recognition functionality and supports matching with regular expressions, which you can use to look for your project folder.


#3

Sounds interesting.
But it seems that this package uses config.cson to configure the grammar highlighting, so it would change the entire default behavior and not only the settings for a specific project.


#4

If your specific project is in a specific directory, you can change the behavior for that directory and it is changed for that specific project and nothing else.


#5

By the way, I finally understood what you mean by change the behavior for that directory. In my case, I did not need any file as config.cson or project.cson, but I had to add manually settings into main projects.<user>.cson.

Thanks.