Where can I find a list of areas for Sublime2 (or textMate?)

in .tmTheme files, the region key determines how the element is allocated:

<dict> <key>name</key> <string>HTML: Attribute Values</string> <key>scope</key> <string>meta.tag string.quoted, meta.tag string.quoted constant.character.entity</string> <key>settings</key> <dict> <key>background</key> <string>#FFFFFF</string> <key>fontStyle</key> <string></string> <key>foreground</key> <string>#2aa198</string> </dict> </dict> 

Where can I find a list of all areas supported by these applications, so I can create my own style?

+49
sublimetext textmate
May 31 '12 at 13:37
source share
7 answers

Unfortunately, it seems that such a comprehensive list does not exist.

However, if you press Shift + Ctrl + P in SublimeText 2, the status bar at the bottom of the screen displays a complete list of all the scope keys that apply to the character immediately after the cursor position.

You can use this method to find the area keys for everything you need in SublimeText.

+30
Feb 16 '13 at 5:39
source share

Copy / paste (but convert HTML to Markdown) from the current version of the "Naming Conventions" section in the TextMate Grammar Guide :

  • comment - for comments.
    • line - comments on lines, we additionally specialize in the fact that the character type of the beginning of a comment can be extracted from the scope.
      • double-slash - // comment
      • double-dash - -- comment
      • number-sign - # comment
      • percentage - % comment
      • character - other types of line comments.
    • block - multi-line comments, such as /* … */ and <!-- … --> .
      • documentation - built-in documentation.
  • constant - various forms of constants.
    • numeric - those that represent numbers, for example. 42 , 1.3f , 0x4AB1U .
    • character - those that represent characters, for example. &lt; , \e , \031 .
      • escape - escape sequences such as \e would be constant.character.escape .
    • language - constants (usually) provided by the language, which are "special", such as true , false , nil , YES , NO , etc.
    • other - other constants, for example. colors in CSS.
  • entity - An object refers to most of a document, such as a chapter, class, function, or tag. We do not cover the entire object as entity.* (For this we use meta.* ). But we use entity.* For “placeholders” in a larger object, for example. if the object is a chapter, we would use entity.name.section for the title of the chapter.
    • name - we call a larger object.
      • function is the name of the function.
      • type - the name of the declaration of the type or class.
      • tag is the name of the tag.
      • section - name - section / title name.
    • other - other objects.
      • inherited-class is the name of the superclass / base word.
      • attribute-name - attribute name (mainly in tags).
  • invalid - material that is invalid.
    • illegal - illegal, for example. ampersand or lower character in HTML (which is not part of the entity / tag).
    • deprecated - for obsolete things, for example. using an API function that is deprecated or uses style with strict HTML.
  • keyword - keywords (if they do not fall into other groups).
    • control - mainly related to flow control, for example, continue , while , return , etc.
    • operator - operators can be textual (for example, or ) or be characters.
    • other - other keywords.
  • markup is for markup languages ​​and is usually applied to larger subsets of text.
    • underline - underlined text.
      • link is for links, as a convenience it comes from markup.underline , so if there is no theme rule that is specifically designed for markup.underline.link , then it inherits the underline style.
    • bold - bold text (text that is strong and similar should preferably be derived from this name).
    • heading - section heading. Optionally, specify the header level as the next element, for example markup.heading.2.html for <h2>…</h2> in HTML.
    • italic - italic text (text that is highlighted and similar should preferably be derived from this name).
    • list - a list of items.
      • numbered - numbered list items.
      • unnumbered - unnumbered list items.
    • quote - quoted (sometimes quoted block) text.
    • raw is text that is verbatim, for example. lists of codes. Typically, spell checking is disabled for markup.raw .
    • other - other markup constructs.
  • meta - A meta object is commonly used to mark up large parts of a document. For example, the entire line declaring a function will be meta.function , and the subsets will be storage.type , entity.name.function , variable.parameter , etc., And only the last one will be styled. Sometimes the meta part of an area will only be used to limit the more general element that is used in the style, however, most temporary metadata is used in area selectors to activate the elements of the package. For example, in Objective-C, there is a meta area for declaring a class interface and implementation, allowing the same trigger tabs to expand differently, depending on the context.
  • storage - things related to "storage".
    • type - the type of something, class , function , int , var , etc.
    • modifier - storage modifier such as static , final , abstract , etc.
  • string - strings.
    • quoted quoted lines.
      • single - single quotes: 'foo' .
      • double - double-quoted strings: "foo" .
      • triple - triple quoted strings: """Python""" .
      • other - other types of citation: $'shell' , %s{...} .
    • unquoted - for things like here-docs and here-strings.
    • interpolated - strings that are "evaluated": date , $(pwd) .
    • regexp - regular expressions: /(\w+)/ .
    • other - other types of strings (rarely used).
  • support - things provided by the framework or library should be lower than support .
    • function - functions provided by the framework / library. For example, the NSLog in Objective-C has support.function .
    • class - when the environment / library provides classes.
    • type - the types provided by the infrastructure / library are probably used only for languages ​​derived from C, which has typedef (and struct ). Most other languages ​​will introduce new types as classes.
    • constant - constants (magic values) provided by the framework / library.
    • variable - variables provided by the framework / library. For example, NSApp in AppKit.
    • other - the above should be comprehensive, but use support.other for the rest.
  • variable - variables. Not all languages ​​make it easy to identify (and therefore markup) these.
    • parameter - when a variable is declared as a parameter.
    • language - reserved language variables such as this , super , self , etc.
    • other - other variables, such as $some_variables .
+67
Feb 20 '14 at 17:09
source share

There are several great text packages you can use for this.

Install package management

Go to https://sublime.wbond.net/ and click "Install" and follow the instructions to install the batch file manager.

Packages displaying the current scope

I know a couple of sublime text packages that display the current scope in the status bar.

Installing one of the overlying packages

To install a package with an elevated text package manager, open the sublime text command palette ( ctrl+shift+p ) and select Package Control: Install Package , and then select one of the above packages.

+14
Aug 16 '13 at 13:12
source share

Areas from tmLanguage files that differ for each syntax. You can find a list of area naming conventions at http://manual.macromates.com/en/language_grammars

+11
Jun 01 '12 at 5:05
source share

In addition to the excellent answers already posted, the Scopes Stats TMTheme Editor tab displays a useful list of all areas in 236 color themes, with the most frequently used areas at the top.

+5
Dec 18 '14 at 19:20
source share

There is no set of area lists; they are created by the syntax for each file type. For example, your syntax may indicate that the function scope is storage.type.function.js . If your theme supports this directly, it will use that color, otherwise it will return to storage.type.function , then storage.type and then storage , trying to find the color in your theme.

Since you are creating your own style, I would recommend installing ScopeStatus ( CTRL + SHIFT + P , then install the package, then ScopeStatus). Looking at the file with the syntax you want to focus on, do CTRL + SHIFT + P , then "Zoom: show on status bar". Now you can move the cursor over the various elements to see which area they give, and you can use them to define colors.

You can check your topics to find out what they are doing, go to "Settings-> Package Overview" to open the folder where your packages are stored. I installed "Theme - Phoenix", which has a folder and a folder "Color Scheme". In one of the theme files, I found 16 colors that were used for various areas:

 keyword.operator.class, constant.other, source.php.embedded.line variable, support.other.variable, string.other.link, entity.name.tag, entity.other.attribute-name, meta.tag, declaration.tag constant.numeric, constant.language, support.constant, constant.character, variable.parameter, punctuation.section.embedded, keyword.other.unit entity.name.class, entity.name.type.class, support.type, support.class string, constant.other.symbol, entity.other.inherited-class, markup.heading keyword.operator, constant.other.color entity.name.function, meta.function-call, support.function, keyword.other.special-method, meta.block-level keyword, storage, storage.type, entity.name.tag.css invalid meta.separator invalid.deprecated markup.inserted.diff, markup.deleted.diff, meta.diff.header.to-file, meta.diff.header.from-file markup.inserted.diff, meta.diff.header.to-file markup.deleted.diff, meta.diff.header.from-file meta.diff.header.from-file, meta.diff.header.to-file meta.diff.range 

Different themes can have different settings, because the .operator.class keyword in the first group can have its own color or be the same as meta.diff.range.

+2
Nov 22 '15 at 8:23
source share

See the help guide on the elevated site below:

+2
Sep 28 '16 at 2:09
source share



All Articles