Theme settings explanation

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Theme settings explanation

Umberto Cerrato
Hello everyone,

Who can explain me what these settings are for?
Specifically: Scope Selector, Key Equivalent, Tag Trigger options.

I’m in “Edit Bundles… > Themes”

Best, u


_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Theme settings explanation

Jacob Carlborg
I don’t think most of these settings make sense for a theme. They are more for other bundle items, like commands or snippets.

Scope Selector: this indicates which scope a given bundle item should apply to. This is usually used make a command only be available for a specific language. 

Key Equivalent: this is the keyboard shortcut that will activate the bundle item. This is usually used to run a command.

Tab Trigger: this specifies the text that should precede a press on the tab key. The tab key (in combination with the text) is used to activate the bundle item. This is usually used by snippets. For example, in the Ruby bundle I can type “cla” and then press the tab key. This will activate a bundle item that will replace the text “cla” with a skeleton of a class declaration.

A TextMate bundle can basically contain these bundle items: commands, snippets, language grammars, settings and themes. Editing these bundle items all use the same UI. Not all of the UI will necessarily make sense to use for all types of bundle items. What you see in "Edit Bundles… > Themes” is basically a set of bundles that only contains themes.

On 23 Aug 2019, at 18:27, Umberto Cerrato <[hidden email]> wrote:

Hello everyone,

Who can explain me what these settings are for?
Specifically: Scope Selector, Key Equivalent, Tag Trigger options.

I’m in “Edit Bundles… > Themes”
<textmate-theme.png>

Best, u

_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate

-- 
/Jacob Carlborg



_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Theme settings explanation

Umberto Cerrato
Hi Jacob,

Thank you!!

About the fact that these fields are more for other bundle items: you are right, those settings are quite always there, but I think they have to have a functionality. Otherwise why not removing them? (e.g. Language Grammars has different/more fields. (Although those one are always there…)).

Best, u

PS:
I wrote a mail before about changing the theme based on the file type, a really neat feature IMO. Thanks to Rob MB. I managed to have different themes for different file types.
Eventually the trick there was to use the Scope Selectors to select a specific file type (es. *.c to detect all C files) and set a particular theme for them in the tm properties file.

[ *.c  ]
theme            = "71D40D9D-AE48-11D9-920A-000D93589AF6”
tabSize.         = 4

Now, when I first read about Scope Selector in theme settings inside Edit Bundles I thought that that field (Scope Selector) could be the one that would change the theme based on file type.
(Unfortunately it seems it does not work) Anyway, if it (specifically the Scope Selector field) is really useless ATM, I would suggest to make it the field for the assignment of certain file types to certain custom themes.

> Il giorno 23 ago 2019, alle ore 19:42, Jacob Carlborg <[hidden email]> ha scritto:
>
> I don’t think most of these settings make sense for a theme. They are more for other bundle items, like commands or snippets.
>
> Scope Selector: this indicates which scope a given bundle item should apply to. This is usually used make a command only be available for a specific language.
>
> Key Equivalent: this is the keyboard shortcut that will activate the bundle item. This is usually used to run a command.
>
> Tab Trigger: this specifies the text that should precede a press on the tab key. The tab key (in combination with the text) is used to activate the bundle item. This is usually used by snippets. For example, in the Ruby bundle I can type “cla” and then press the tab key. This will activate a bundle item that will replace the text “cla” with a skeleton of a class declaration.
>
> A TextMate bundle can basically contain these bundle items: commands, snippets, language grammars, settings and themes. Editing these bundle items all use the same UI. Not all of the UI will necessarily make sense to use for all types of bundle items. What you see in "Edit Bundles… > Themes” is basically a set of bundles that only contains themes.
>
>> On 23 Aug 2019, at 18:27, Umberto Cerrato <[hidden email]> wrote:
>>
>> Hello everyone,
>>
>> Who can explain me what these settings are for?
>> Specifically: Scope Selector, Key Equivalent, Tag Trigger options.
>>
>> I’m in “Edit Bundles… > Themes”
>> <textmate-theme.png>
>>
>> Best, u
>>
>> _______________________________________________
>> TextMate mailing list
>> [hidden email]
>> https://lists.macromates.com/listinfo/textmate
>
> --
> /Jacob Carlborg
>
>
> _______________________________________________
> TextMate mailing list
> [hidden email]
> https://lists.macromates.com/listinfo/textmate


_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Theme settings explanation

Umberto Cerrato
Hi,

> Il giorno 26 ago 2019, alle ore 10:20, Allan Odgaard <[hidden email]> ha scritto:
>
> On 23 Aug 2019, at 20:33, Umberto Cerrato wrote:
>
> About the fact that these fields are more for other bundle items: you are right, those settings are quite always there, but I think they have to have a functionality. Otherwise why not removing them? (e.g. Language Grammars has different/more fields. (Although those one are always there…)).
>
> We prefer to keep things general because they can be used, and some users do find creative ways to do things.
>

Yeah, so they HAVE functionality. It seemed they were just placeholders.

> In the case of the scope selector, this limits the scope in which the key equivalent or tab trigger has an effect.
>
> So for example in the case of themes, let’s imagine we have two themes, theme A and theme B. We could assign both of these themes a key equivalent of ⌘1 but different scope selectors, e.g. source.c and text.html.
>

That’s great!!

> What this would allow is to press ⌘1 in a source.c file and switch to theme A, yet in text.html the same key would switch to theme B.
>

And this is cool.

> If someone would actually find this useful, I do not know, but knowing that all bundle items can (more or less) be treated the same, I think has value in itself.
>

I find them useful :)
Indeed

Thank you

Best, u

>
> _______________________________________________
> TextMate mailing list
> [hidden email]
> https://lists.macromates.com/listinfo/textmate


_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate