ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Syntax​Manager

by randy3k ALL

Applying settings to a given syntax/extension

Details

Installs

  • Total 12K
  • Win 6K
  • Mac 4K
  • Linux 2K
Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 Jan 30 Jan 29 Jan 28 Jan 27 Jan 26 Jan 25 Jan 24 Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8
Windows 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 1 1 0 1 0 0 0 0 1 0 0 0 1 0 1 0 0 0 2
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0
01234Feb 21Feb 18Feb 15Feb 12Feb 9Feb 6Feb 3Jan 31Jan 28Jan 25Jan 22Jan 19Jan 16Jan 13Jan 10Feb 21 Linux: 0 Mac: 0 Windows: 0Feb 20 Linux: 0 Mac: 0 Windows: 0Feb 19 Linux: 0 Mac: 0 Windows: 0Feb 18 Linux: 0 Mac: 0 Windows: 0Feb 17 Linux: 0 Mac: 0 Windows: 0Feb 16 Linux: 0 Mac: 0 Windows: 0Feb 15 Linux: 0 Mac: 0 Windows: 0Feb 14 Linux: 0 Mac: 0 Windows: 1Feb 13 Linux: 0 Mac: 0 Windows: 0Feb 12 Linux: 0 Mac: 0 Windows: 0Feb 11 Linux: 0 Mac: 0 Windows: 1Feb 10 Linux: 0 Mac: 0 Windows: 0Feb 9 Linux: 0 Mac: 0 Windows: 0Feb 8 Linux: 0 Mac: 0 Windows: 1Feb 7 Linux: 0 Mac: 1 Windows: 0Feb 6 Linux: 0 Mac: 1 Windows: 0Feb 5 Linux: 0 Mac: 0 Windows: 0Feb 4 Linux: 0 Mac: 0 Windows: 0Feb 3 Linux: 0 Mac: 0 Windows: 0Feb 2 Linux: 0 Mac: 0 Windows: 0Feb 1 Linux: 0 Mac: 0 Windows: 0Jan 31 Linux: 0 Mac: 0 Windows: 1Jan 30 Linux: 0 Mac: 0 Windows: 0Jan 29 Linux: 0 Mac: 0 Windows: 0Jan 28 Linux: 0 Mac: 0 Windows: 0Jan 27 Linux: 0 Mac: 0 Windows: 1Jan 26 Linux: 0 Mac: 0 Windows: 1Jan 25 Linux: 0 Mac: 0 Windows: 1Jan 24 Linux: 0 Mac: 0 Windows: 0Jan 23 Linux: 0 Mac: 0 Windows: 1Jan 22 Linux: 0 Mac: 0 Windows: 0Jan 21 Linux: 0 Mac: 0 Windows: 0Jan 20 Linux: 1 Mac: 0 Windows: 0Jan 19 Linux: 0 Mac: 0 Windows: 0Jan 18 Linux: 0 Mac: 0 Windows: 1Jan 17 Linux: 0 Mac: 0 Windows: 0Jan 16 Linux: 0 Mac: 1 Windows: 0Jan 15 Linux: 0 Mac: 0 Windows: 0Jan 14 Linux: 0 Mac: 0 Windows: 1Jan 13 Linux: 0 Mac: 0 Windows: 0Jan 12 Linux: 0 Mac: 0 Windows: 1Jan 11 Linux: 0 Mac: 0 Windows: 0Jan 10 Linux: 1 Mac: 0 Windows: 0Jan 9 Linux: 0 Mac: 0 Windows: 0Jan 8 Linux: 0 Mac: 0 Windows: 2Feb 21 Linux: 0 Mac: 0 Windows: 0Feb 20 Linux: 0 Mac: 0 Windows: 0Feb 19 Linux: 0 Mac: 0 Windows: 0Feb 18 Linux: 0 Mac: 0 Windows: 0Feb 17 Linux: 0 Mac: 0 Windows: 0Feb 16 Linux: 0 Mac: 0 Windows: 0Feb 15 Linux: 0 Mac: 0 Windows: 0Feb 14 Linux: 0 Mac: 0 Windows: 1Feb 13 Linux: 0 Mac: 0 Windows: 0Feb 12 Linux: 0 Mac: 0 Windows: 0Feb 11 Linux: 0 Mac: 0 Windows: 1Feb 10 Linux: 0 Mac: 0 Windows: 0Feb 9 Linux: 0 Mac: 0 Windows: 0Feb 8 Linux: 0 Mac: 0 Windows: 1Feb 7 Linux: 0 Mac: 1 Windows: 0Feb 6 Linux: 0 Mac: 1 Windows: 0Feb 5 Linux: 0 Mac: 0 Windows: 0Feb 4 Linux: 0 Mac: 0 Windows: 0Feb 3 Linux: 0 Mac: 0 Windows: 0Feb 2 Linux: 0 Mac: 0 Windows: 0Feb 1 Linux: 0 Mac: 0 Windows: 0Jan 31 Linux: 0 Mac: 0 Windows: 1Jan 30 Linux: 0 Mac: 0 Windows: 0Jan 29 Linux: 0 Mac: 0 Windows: 0Jan 28 Linux: 0 Mac: 0 Windows: 0Jan 27 Linux: 0 Mac: 0 Windows: 1Jan 26 Linux: 0 Mac: 0 Windows: 1Jan 25 Linux: 0 Mac: 0 Windows: 1Jan 24 Linux: 0 Mac: 0 Windows: 0Jan 23 Linux: 0 Mac: 0 Windows: 1Jan 22 Linux: 0 Mac: 0 Windows: 0Jan 21 Linux: 0 Mac: 0 Windows: 0Jan 20 Linux: 1 Mac: 0 Windows: 0Jan 19 Linux: 0 Mac: 0 Windows: 0Jan 18 Linux: 0 Mac: 0 Windows: 1Jan 17 Linux: 0 Mac: 0 Windows: 0Jan 16 Linux: 0 Mac: 1 Windows: 0Jan 15 Linux: 0 Mac: 0 Windows: 0Jan 14 Linux: 0 Mac: 0 Windows: 1Jan 13 Linux: 0 Mac: 0 Windows: 0Jan 12 Linux: 0 Mac: 0 Windows: 1Jan 11 Linux: 0 Mac: 0 Windows: 0Jan 10 Linux: 1 Mac: 0 Windows: 0Jan 9 Linux: 0 Mac: 0 Windows: 0Jan 8 Linux: 0 Mac: 0 Windows: 2Feb 21 Linux: 0 Mac: 0 Windows: 0Feb 20 Linux: 0 Mac: 0 Windows: 0Feb 19 Linux: 0 Mac: 0 Windows: 0Feb 18 Linux: 0 Mac: 0 Windows: 0Feb 17 Linux: 0 Mac: 0 Windows: 0Feb 16 Linux: 0 Mac: 0 Windows: 0Feb 15 Linux: 0 Mac: 0 Windows: 0Feb 14 Linux: 0 Mac: 0 Windows: 1Feb 13 Linux: 0 Mac: 0 Windows: 0Feb 12 Linux: 0 Mac: 0 Windows: 0Feb 11 Linux: 0 Mac: 0 Windows: 1Feb 10 Linux: 0 Mac: 0 Windows: 0Feb 9 Linux: 0 Mac: 0 Windows: 0Feb 8 Linux: 0 Mac: 0 Windows: 1Feb 7 Linux: 0 Mac: 1 Windows: 0Feb 6 Linux: 0 Mac: 1 Windows: 0Feb 5 Linux: 0 Mac: 0 Windows: 0Feb 4 Linux: 0 Mac: 0 Windows: 0Feb 3 Linux: 0 Mac: 0 Windows: 0Feb 2 Linux: 0 Mac: 0 Windows: 0Feb 1 Linux: 0 Mac: 0 Windows: 0Jan 31 Linux: 0 Mac: 0 Windows: 1Jan 30 Linux: 0 Mac: 0 Windows: 0Jan 29 Linux: 0 Mac: 0 Windows: 0Jan 28 Linux: 0 Mac: 0 Windows: 0Jan 27 Linux: 0 Mac: 0 Windows: 1Jan 26 Linux: 0 Mac: 0 Windows: 1Jan 25 Linux: 0 Mac: 0 Windows: 1Jan 24 Linux: 0 Mac: 0 Windows: 0Jan 23 Linux: 0 Mac: 0 Windows: 1Jan 22 Linux: 0 Mac: 0 Windows: 0Jan 21 Linux: 0 Mac: 0 Windows: 0Jan 20 Linux: 1 Mac: 0 Windows: 0Jan 19 Linux: 0 Mac: 0 Windows: 0Jan 18 Linux: 0 Mac: 0 Windows: 1Jan 17 Linux: 0 Mac: 0 Windows: 0Jan 16 Linux: 0 Mac: 1 Windows: 0Jan 15 Linux: 0 Mac: 0 Windows: 0Jan 14 Linux: 0 Mac: 0 Windows: 1Jan 13 Linux: 0 Mac: 0 Windows: 0Jan 12 Linux: 0 Mac: 0 Windows: 1Jan 11 Linux: 0 Mac: 0 Windows: 0Jan 10 Linux: 1 Mac: 0 Windows: 0Jan 9 Linux: 0 Mac: 0 Windows: 0Jan 8 Linux: 0 Mac: 0 Windows: 2

Readme

Source
raw.​githubusercontent.​com

Syntax Manager for Sublime Text 2/3

It helps in applying settings to given syntaxes and extensions.

I don't understand why Sublime Text makes it so difficult to apply the same setting across several different syntaxes. For example, if someone want to enable auto_match_enabled for python and c, they has to create two files: - Packages/User/Python.sublime-settings - Packages/User/C.sublime-settings

Then, in each of the files, add:

"auto_match_enabled": true

This plugin makes it easier by considering following setting in Syntax Manger:

"syntaxmgr_settings": [
        {
            "scopes": ["source.c", "source.python"],
            "settings": {
                "auto_match_enabled" : true
            }
        }
    ]

Installation

Package Control!

Usage

Open Preference -> Syntax Manager. Below is a sample of what you can specify in the settings file. For each item, you need to provide at least one of the filters

  • scopes
  • scopes_excluded
  • extensions
  • platforms
  • hostnames
  • first_line_match
{
    "syntaxmgr_settings": [
        {
            // platforms, can be osx, windows or linux
            "platforms": ["linux", "windows"],
            "settings": {
                "font_size" : 14
            }
        },
        {
            // match a specific computer based on hostname
            // the hostname can be found by running
            //
            //     import platform
            //     platform.node()
            //
            // at sublime console (ctrl + ` )
            //
            "hostnames": ["some-hostname"],
            "settings": {
                "font_size" : 12
            }
        },
        {
            // multiple filters can be applied to the same item
            "platforms": ["linux", "windows"],
            "hostnames": ["some-hostname"],
            "settings": {
                "font_size" : 12
            }
        },
        {
            // apply this setting when first line matches
            "first_line_match": ["#!/.*?/sh"],
            "settings": {
                // the syntax can be identified by running
                //
                //     view.settings().get("syntax")
                //
                // at sublime console (ctrl + ` )
                //
                "syntax" : "Packages/ShellScript/Shell-Unix-Generic.tmLanguage"
            }
        },
        {
            // the scope of the document can be obtained by pressing
            // cmd+alt+p (mac) or ctrl+alt+shift+p (linux / windows)

            // for c and python files
            "scopes": ["source.c", "source.python"],
            "settings": {
                "trim_trailing_white_space_on_save_scope" : true,
                "auto_match_enabled" : true
            }
        },
        {
            // all text files
            "scopes": ["text"],
            "settings": {
                "spell_check": true,
                "color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme"
            }
        },
        {
            // use latex syntex for these extensions
            // make sure the syntax is applied first and then the settings
            "extensions": ["ltx", "latex", "l"],
            "settings": {
                "syntax": "Packages/LaTeX/LaTeX.tmLanguage"
            }
        },
        {
            // for all text files, excluding latex files
            "scopes": ["text"],
            "scopes_excluded": ["text.tex"],
            "settings": {
                "spell_check": false
            }
        }
    ]
}

Reload Settings

Occasionally, syntax manager may fail to apply settings automatically, especially when creating new file. Reloading syntax manger will be helpful in this situation. To reload settings, launch comment palette (C+shift+p) and type “Syntax Manager: Reload Settings”.