Skip to content

Instantly share code, notes, and snippets.

@kuniss
Created April 16, 2019 15:01
Show Gist options
  • Select an option

  • Save kuniss/e1012cffe784919ce664bee0cd07971c to your computer and use it in GitHub Desktop.

Select an option

Save kuniss/e1012cffe784919ce664bee0cd07971c to your computer and use it in GitHub Desktop.

Revisions

  1. kuniss created this gist Apr 16, 2019.
    370 changes: 370 additions & 0 deletions textmate.styles.iro
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,370 @@
    styles [] {

    # textmate focused scopes

    # comment — for comments.

    # // comment
    .comment_line_double_slash : style {
    color = light_green
    italic = true
    ace_scope = comment.line.double-slash
    textmate_scope = comment.line.double-slash
    pygments_scope = Comment.Single
    }

    # block — multi-line comments like /* … */ and <!-- … -->.
    .comment_block : style {
    color = green
    italic = true
    ace_scope = comment.block
    textmate_scope = comment.block
    pygments_scope = Comment.Multiline
    }

    # numeric — those which represent numbers, e.g. 42, 1.3f, 0x4AB1U.
    .constant_numeric : style {
    color = yellow
    ace_scope = constant.numeric
    textmate_scope = constant.numeric
    pygments_scope = Number
    }

    # character — those which represent characters, e.g. &lt;, \e, \031.
    .constant_character_escape : style {
    color = violet
    ace_scope = constant.character.escape
    textmate_scope = constant.character.escape
    pygments_scope = String.Escape
    }

    # language — constants (generally) provided by the language which are “special” like true, false, nil, YES, NO, etc.
    .constant_language : style {
    color = violet_red
    ace_scope = constant.language
    textmate_scope = constant.language
    pygments_scope = Literal
    }

    # other — other constants, e.g. colors in CSS.
    .constant_other : style {
    color = violet
    ace_scope = constant.other
    textmate_scope = constant.other
    pygments_scope = Keyword.Constant
    }


    # entity — an entity refers to a larger part of the document, for example a chapter, class, function, or tag. We do not scope the entire entity as entity.* (we use meta.* for that). But we do use entity.* for the “placeholders” in the larger entity, e.g. if the entity is a chapter, we would use entity.name.section for the chapter title.

    # name — we are naming the larger entity.
    .entity_name : style {
    color = light_yellow
    ace_scope = entity.name
    textmate_scope = entity.name
    pygments_scope = Name
    }

    # function — the name of a function.
    .entity_function : style {
    color = light_yellow
    ace_scope = entity.name.function
    textmate_scope = entity.name.function
    pygments_scope = Name.Function
    }

    # type — the name of a type declaration or class.
    .entity_type : style {
    color = light_yellow
    ace_scope = entity.name.type
    textmate_scope = entity.name.type
    pygments_scope = Name.Class
    }

    # tag — a tag name.
    .entity_tag : style {
    color = light_yellow
    ace_scope = entity.name.tag
    textmate_scope = entity.name.tag
    pygments_scope = Name.Tag
    }

    # section — the name is the name of a section/heading.
    .entity_section : style {
    color = light_yellow
    ace_scope = entity.name.section
    textmate_scope = entity.name.section
    pygments_scope = Name.Namespace
    }

    # other — other entities.
    .entity_other : style {
    color = light_yellow
    ace_scope = entity.other
    textmate_scope = entity.other
    pygments_scope = Name.Other
    }

    # inherited-class — the superclass/baseclass name.
    .entity_inherited_class : style {
    color = light_yellow
    ace_scope = entity.inherited-class
    textmate_scope = entity.inherited-class
    pygments_scope = Name.Variable.Class
    }

    # invalid — stuff which is “invalid”.
    .invalid : style {
    color = red
    ace_scope = invalid
    textmate_scope = invalid
    pygments_scope = Generic.Error
    }

    # illegal — illegal, e.g. an ampersand or lower-than character in HTML (which is not part of an entity/tag).
    .invalid_illegal : style {
    color = red
    ace_scope = invalid.illegal
    textmate_scope = invalid.illegal
    pygments_scope = Generic.Error
    }

    # deprecated — for deprecated stuff e.g. using an API function which is deprecated or using styling with strict HTML.
    .invalid_deprecated : style {
    color = red
    ace_scope = invalid.deprecated
    textmate_scope = invalid.deprecated
    pygments_scope = Generic.Error
    }

    # keyword — keywords (when these do not fall into the other groups).
    .keyword : style {
    color = violet_red
    bold = true
    ace_scope = keyword
    textmate_scope = keyword
    pygments_scope = Keyword
    }

    # control — mainly related to flow control like continue, while, return, etc.
    .keyword_control : style {
    color = violet_red
    bold = true
    ace_scope = keyword.control
    textmate_scope = keyword.control
    pygments_scope = Keyword.Reserved
    }

    # operator — operators can either be textual (e.g. or) or be characters.
    .keyword_operator : style {
    color = violet_red
    bold = true
    ace_scope = keyword.operator
    textmate_scope = keyword.operator
    pygments_scope = Operator
    }

    # other — other keywords.
    .keyword_other : style {
    color = violet_red
    bold = true
    ace_scope = keyword.other
    textmate_scope = keyword.other
    pygments_scope = Keyword.Pseudo
    }

    # storage — things relating to “storage”.

    # type — the type of something, class, function, int, var, etc.
    .storage_type : style {
    color = violet_red
    ace_scope = comment
    textmate_scope = storage.type
    pygments_scope = Keyword.Type
    }

    # modifier — a storage modifier like static, final, abstract, etc.
    .storage_modifier : style {
    color = violet_red
    ace_scope = storage.modifier
    textmate_scope = storage.modifier
    pygments_scope = Keyword.Declaration
    }

    # string — strings.
    # quoted — quoted strings.
    .string_quoted : style {
    color = light_blue
    ace_scope = string.quoted
    textmate_scope = string.quoted
    pygments_scope = String
    }

    # single — single quoted strings: 'foo'.
    .string_quoted_single : style {
    color = light_blue
    ace_scope = string.quoted.single
    textmate_scope = string.quoted.single
    pygments_scope = String.Single
    }

    # double — double quoted strings: "foo".
    .string_quoted_double : style {
    color = light_blue
    ace_scope = string.quoted.double
    textmate_scope = string.quoted.double
    pygments_scope = String.Double
    }

    # triple — triple quoted strings: """Python""".
    .string_quoted_triple : style {
    color = light_blue
    ace_scope = string.quoted.triple
    textmate_scope = string.quoted.triple
    pygments_scope = String.Symbol
    }

    # other — other types of quoting: $'shell', %s{...}.
    .string_quoted_other : style {
    color = light_blue
    ace_scope = string.quoted.other
    textmate_scope = string.quoted.other
    pygments_scope = String.Char
    }

    # unquoted — for things like here-docs and here-strings.
    .string_unquoted : style {
    color = light_blue
    ace_scope = string.unquoted
    textmate_scope = string.unquoted
    pygments_scope = String.Heredoc
    }

    # interpolated — strings which are “evaluated”: `date`, $(pwd).
    .string_interpolated : style {
    color = light_blue
    ace_scope = string.interpolated
    textmate_scope = string.interpolated
    pygments_scope = String.Interpol
    }

    # regexp — regular expressions: /(\w+)/.
    .string_regexp : style {
    color = light_blue
    ace_scope = string.regexp
    textmate_scope = string.regex
    pygments_scope = String.Regex
    }

    # other — other types of strings (should rarely be used).
    .string_other : style {
    color = light_blue
    ace_scope = string.other
    textmate_scope = string.other
    pygments_scope = String.Other
    }

    # support — things provided by a framework or library should be below support.

    # function — functions provided by the framework/library. For example NSLog in Objective-C is support.function.
    .support_function : style {
    color = light_blue
    ace_scope = support.function
    textmate_scope = support.function
    pygments_scope = Name.Variable.Global
    }

    # class — when the framework/library provides classes.
    .support_class : style {
    color = light_blue
    ace_scope = support.class
    textmate_scope = support.class
    pygments_scope = Name.Decorator
    }

    # type — types provided by the framework/library, this is probably only used for languages derived from C, which has typedef (and struct). Most other languages would introduce new types as classes.
    .support_type : style {
    color = light_blue
    ace_scope = support.type
    textmate_scope = support.type
    pygments_scope = Name.Entity
    }

    # constant — constants (magic values) provided by the framework/library.
    .support_constant : style {
    color = light_blue
    ace_scope = support.constant
    textmate_scope = support.constant
    pygments_scope = Name.Constant
    }

    # variable — variables provided by the framework/library. For example NSApp in AppKit.
    .support_variable : style {
    color = light_blue
    ace_scope = support.variable
    textmate_scope = support.variable
    pygments_scope = Name.Variable.Instance
    }

    # other — the above should be exhaustive, but for everything else use support.other.
    .support_other : style {
    color = light_blue
    ace_scope = support.other
    textmate_scope = support.other
    pygments_scope = Name.Builtin.Pseudo
    }

    # variable — variables. Not all languages allow easy identification (and thus markup) of these.
    .variable : style {
    color = yellow
    ace_scope = variable
    textmate_scope = variable
    pygments_scope = Name.Variable
    }

    # parameter — when the variable is declared as the parameter.
    .variable_parameter : style {
    color = yellow
    ace_scope = variable.parameter
    textmate_scope = variable.parameter
    pygments_scope = Name.Attribute
    }

    # language — reserved language variables like this, super, self, etc.
    .variable_language : style {
    color = yellow
    ace_scope = variable.language
    textmate_scope = variable.language
    pygments_scope = Name.Builtin
    }

    # other — other variables, like $some_variables.
    .variable_other : style {
    color = yellow
    ace_scope = variable.other
    textmate_scope = variable.other
    pygments_scope = Name.Label
    }

    # end -- textmate focused scopes


    .punctuation : style {
    color = violet
    ace_scope = punctuation
    textmate_scope = punctuation
    pygments_scope = Punctuation
    }

    .parenthesis : style {
    color = violet
    ace_scope = keyword punctuation
    textmate_scope = keyword punctuation
    pygments_scope = Operator.Word
    }

    .whitespace : style {
    ace_scope = whitespace
    textmate_scope = whitespace
    pygments_scope = Generic
    }