Skip to content
This repository has been archived by the owner on Feb 24, 2022. It is now read-only.

Configuration

kdvolder edited this page Mar 13, 2013 · 16 revisions

Scripted is configured via a JSON formatted ~/.scriptedrc/scripted.json in your user's home directory or a .scripted file in the project root. There is no UI support for configuration. Just edit your .scripted file using scripted.

This page describes all configuration recognized in the configuration files. All the elements are optional. Anything supplied in .scripted or ~/.scriptedrc/scripted.json will override built-in defaults. Conflicts between .scripted and ~/.scriptedrc/scripted.json are resolved in favor of .scripted.

See issue SCRIPTED-76 for more detailed information on how .scriptedrc and .scripted get merged.

The config file is of this form:

{
  "formatter": {
    "js": {
      "indent_size": 1,
      "indent_char": "\t"
    }
  },
  "ui": {
    "font":"Monaco",
    "font_size":12,
    "navigator": false
  }
}

Configuration options

  • ui
    • font : String - the name of the font
    • font_size : num - the size of the font
    • navigator : bool (determine whether to hide/show the navigator)
    • font_size_breadcrumb : num - the font size for the breadcrumb text
    • font_size_nav : num - the font size for the navigator
    • font_size_help : num - the font size for the help panel

Example:

    {
        "ui": {
            "font":"Monaco",
            "font_size":12,
            "navigator": false
        }
    }
  • jshint See the JSHint docs for a full list of options. In the jshint section the contents of the options section is equivalent to what you would include in a .jshintrc file.
    • options : list of jshint options
    • global : list of global variables. This can be used as an alternative to setting options.predef

Example:

    {
       "jshint": {
           "options": {
               "browser": true
           },
           "global": [ "require", "console", "foo" ]
       }
    }
  • formatter
    • js
      • indent_size (default 4) : indentation size,
      • indent_char (default space) : character to indent with,
      • preserve_newlines (default true) : whether existing line breaks should be preserved,
      • preserve_max_newlines (default unlimited) : maximum number of line breaks to be preserved in one chunk
      • jslint_happy (default false) : if true, then jslint-stricter mode is enforced. jslint_happy will give 'function ()' !jslint_happy will give 'function()'
      • brace_style (default "collapse") :
        • collapse put braces on the same line as control statements (default),
        • expand put braces on own line (Allman / ANSI style)
        • end-expand put end braces on own line.
        • expand-strict put brace on own line even in such cases:
        var a =
        {
            a: 5,
            b: 6
        }
         This mode may break your scripts, so beware\! - e.g when returning an object literal.
    * `space_before_conditional` (default true) should the space before conditional statement be added, `if(true)` vs if (true)`
    * `unescape_strings` (default false) ? should printable characters in strings encoded in \xNN notation be unescaped, `"example"` vs `"\x65\x78\x61\x6d\x70\x6c\x65"`

Example:

    {
        "formatter": {
            "js": {
                "indent_size": 1,
                "indent_char": "\t"
            }
        }
    }
  • mark_occurrences : this section configures mark occurrences in the editor.
    • interval : The amount of time between moving the caret and invoking the mark_occurrences operation. Default 500.,
    • disable : If set to true will disable mark occurrences. Default false
    • retain : If set to true will retain the previous marks even after the caret position is moved to another (non-word) location. Default false

Example:

    {
        "mark_occurrences": {
            "interval": 400,
            "disable": false,
            "retain": false
        }
    }
  • exec : this section configures shell commands to be executed when certain keybindings or events occur. For a detailed description visit the Executing Shell Commands page.

Example:

    {
        "exec": {
            "onKeys" : {
                "ctrl+alt+b": {
                    "cmd": "ls -la",
                    "cwd": "${dir}",
                    "name": "ls current dir"
                }
            }
        }
    }
  • editor
    • expandtab : boolean - whether or not to use spaces instead of tabs
    • tabsize : num - the number of spaces to use per tab (not used if expandtab is falsy)
    • unindent_after_close_curly : boolean - can turn OFF the default behaviour of auto unindenting when closing a block
    • indent_after_open_curly : boolean - can turn OFF the default behaviour of auto indenting when starting a block

Example:

    {
        "editor": {
            "expandtab": true,
            "tabsize": 4
        }
    }
  • application
    • webroot : string - set the project subfolder served by the built-in server

The play/stop buttons on the toolbar will start and stop a server that serves the project contents for browsing or interacting with. The default path served is the project root but that can be configured using the setting above.

  • search
    • exclude : string or Array of strings - One or more 'glob' style patterns. Any file or directory matching the pattern is excluded from searches.
    • deemphasized : Array of (string | Array of String) - Patterns that 'de-prioritize' files or directories in searches. Deemphasized directories or files will be searched later and so their matches will be shown below higher-priority matches.

The contents of both the 'Look in Files' and 'Find File Named' dialogs are affected by these settings.

Example:

search: {
   exclude: [
     '**/require.js', 
     '**/*.min.js'
   ],
   deemphasize: [
     '**/test*', //Test files less interesting than others.
     '**/.*',    //'.' files are even less interesting
     [           //Third party library code is the least interesting of all
         '**/node_modules',
         '**/components' //bower installed components
     ]
}
Clone this wiki locally