Hello there,
I would like to make my bundle (grammar and theme) to work for C and C++ sources only. How can I achieve it? This is my actual Grammar configuration, but I would need to restrict the theme to C and C++ too (Since my custom changes are not good for other source files too).
Best [cid:3E4A02AB-3066-4D86-83D5-51DEB58B0BD9@home-life.hub]
On Thu, Oct 3, 2019 at 3:18 AM Umberto Cerrato umbertocerrato@outlook.it wrote:
Hello there,
I would like to make my bundle (grammar and theme) to work for C and C++ sources only. How can I achieve it? This is my actual Grammar configuration, but I would need to restrict the theme to C and C++ too (Since my custom changes are not good for other source files too).
Best
In the Grammer field enter: source.c,source.c++ That will restrict your grammer to only those languages.
In the Scope Selector text box put:
source.c++,source.c
On Oct 3, 2019, at 3:18 AM, Umberto Cerrato umbertocerrato@outlook.it wrote:
Hello there,
I would like to make my bundle (grammar and theme) to work for C and C++ sources only. How can I achieve it? This is my actual Grammar configuration, but I would need to restrict the theme to C and C++ too (Since my custom changes are not good for other source files too).
Best <1.png>
TextMate mailing list TextMate@lists.macromates.com https://lists.macromates.com/listinfo/textmate
Thank you guys,
Eventually this worked for me: So basically just changing the Injection Selector did the work.
About the theme. I think it is not possible to limit itself to a single source. Anyway it is not a problem since I specifically use it only for C and C++. My main theme is another one.
Thanks
Best, -u
[cid:5AFD6FF2-D08A-495A-BC39-4EECD5337FA4@home-life.hub] Il giorno 3 ott 2019, alle ore 17:29, Kyle Kirbatski <kyle.kirby@me.commailto:kyle.kirby@me.com> ha scritto:
In the Scope Selector text box put:
source.c++,source.c
On Oct 3, 2019, at 3:18 AM, Umberto Cerrato <umbertocerrato@outlook.itmailto:umbertocerrato@outlook.it> wrote:
Hello there,
I would like to make my bundle (grammar and theme) to work for C and C++ sources only. How can I achieve it? This is my actual Grammar configuration, but I would need to restrict the theme to C and C++ too (Since my custom changes are not good for other source files too).
Best <1.png>
_______________________________________________ TextMate mailing list TextMate@lists.macromates.commailto:TextMate@lists.macromates.com https://lists.macromates.com/listinfo/textmate
_______________________________________________ TextMate mailing list TextMate@lists.macromates.commailto:TextMate@lists.macromates.com https://lists.macromates.com/listinfo/textmate
On 3 Oct 2019, at 18:09, Umberto Cerrato wrote:
About the theme. I think it is not possible to limit itself to a single source.
If you mean select a certain theme for a specific file or file type, this is possible and was explained in your previous thread “Different Themes based on file type”.
Hi,
Thanks but…
Yes, we already figured out how to select a certain theme for a specific file or file type. But now I would like a theme to not-be-available at all for all the file types, except for one.
e.g. I want C/C++ files to open with this new theme. I can do it in the way you suggested me. And that’s good. But since this theme works well only with C and C++ files, I do not want it to be available/selectable/take effect if there is an opened file with a different extension than .c or .cpp etc.
I think a way of doing it is by making the scopes in the theme to only select c/c++ “items”. I do not know if I made this clear enough. Also I do not know if this last thing can be made… it should be.
Best
Il giorno 14 ott 2019, alle ore 09:38, Allan Odgaard mailinglist@textmate.org ha scritto:
On 3 Oct 2019, at 18:09, Umberto Cerrato wrote:
About the theme. I think it is not possible to limit itself to a single source.
If you mean select a certain theme for a specific file or file type, this is possible and was explained in your previous thread “Different Themes based on file type”.
TextMate mailing list TextMate@lists.macromates.com https://lists.macromates.com/listinfo/textmate
On 14 Oct 2019, at 10:55, Umberto Cerrato wrote:
e.g. I want C/C++ files to open with this new theme. I can do it in the way you suggested me. And that’s good. But since this theme works well only with C and C++ files, I do not want it to be available/selectable/take effect if there is an opened file with a different extension than .c or .cpp etc.
What you can do is open the `.tmTheme` file and insert this under the root `<dict>` element:
<key>hideFromUser</key> <true/>
This will cause the theme to be hidden from the View menu, though also for C/C++ files.
Oh man!! That’s neat!! Thank you very much
Il giorno 14 ott 2019, alle ore 11:14, Allan Odgaard mailinglist@textmate.org ha scritto:
On 14 Oct 2019, at 10:55, Umberto Cerrato wrote:
e.g. I want C/C++ files to open with this new theme. I can do it in the way you suggested me. And that’s good. But since this theme works well only with C and C++ files, I do not want it to be available/selectable/take effect if there is an opened file with a different extension than .c or .cpp etc.
What you can do is open the .tmTheme file and insert this under the root <dict> element:
<key>hideFromUser</key>
<true/>
This will cause the theme to be hidden from the View menu, though also for C/C++ files.
TextMate mailing list TextMate@lists.macromates.com https://lists.macromates.com/listinfo/textmate