Features
This page gives an overview of all the features in Scripted.
Scripted provides several ways to navigate and search your project for content.
The outline view is a dialog containing list of all functions in the current JavaScript file. You can use this to navigate to the declaration of any one of these functions. Typing will filter the list.
You can open the outline view by typing Ctrl/CMD+Shift+O
.
The find file dialog allows you to search for and open files inside of your project.
You can open the find file dialog by typing Ctrl/CMD+Shift+F
.
The search dialog allows you to grep through all files in your project for a particular string.
Scripted uses a standard file navigator on the left-hand side that lists all files in the project and allows quick navigation to them.
Above the editor is a breadcrumb that shows all parent directories of the current file and allows quick navigation to any file in one of those directories.
That strange icon to the left of the breadcrumb is the history navigator. It lists all recently visited files and allows quick navigation to any one of them.
The Scripted editor is borrowed from Eclipse Orion. So, its look and feel will be familiar to many Eclipse users.
Content assist in Scripted uses an inferencer to calculate proposals. The inferencer attempts to propose semantically relevant items, as you can see here:
You can see that fun
and funToo
are proposed with the appropriate return type. Underneath that, you can see the non-inferred proposals. These are any properties found in the file that match the prefix of the current identifier, but cannot be shown to be statically relevant at the location. Since JavaScript is a dynamic language, accuracy in type inferencing will always be weaker than in statically typed languages like Java. For this reason, Scripted also shows the non-inferred proposals in an attempt to propose items that could possibly be relevant.
Scripted has been designed so that it is keyboard-friendly.
(Note: for simplicity we use the Windows/Linux bindings in this section. For Mac users, replace Ctrl
with CMD
and the binding will work.)
The following is a list of the most interesting keybindings:
-
Ctrl+Shift+F
: open find files dialog -
Ctrl+F
: find-in-file -
Ctrl+L
: go to line -
Alt+Shif+F
: Reformat selection or entire file using JSBeautify -
Alt+Up
: Move selected lines up -
Alt+Down
: Move selected lines down -
Alt+Shift+Up
: Copy selected lines up -
Alt+Shift+Down
: Copy selected lines down -
Ctrl+Shift+O
: Show outline -
Ctrl+Space
: Invoke content assist (this keybinding is the same on Mac as on Windows/Linux. Do not usedCMD
) -
Ctrl+Shift+E
: Toggle sub-editor -
Ctrl+Shift+S
: Switch between sub and main editors -
Ctrl+D
: Delete selected lines -
Ctrl+/
: (un-)comment selected lines
And there are others. In the Scripted editor, click on the icon to see a complete list.
Where appropriate, we have used the default Eclipse bindings. However, due to clashes with default browser key-bindings, certain keybindings are not available to Scripted. For example, Ctrl+Shift+R
is open resource in Eclipse, but in browsers, it is a hard refresh. So, in Scripted, we use Ctrl+Shift+F
instead.
Here is a complete listing of configuration options available in the .scripted file:
- ui
- font : String
- fontsize : num
- navigator : bool (hide/show the navigator)
- jslint See the jslint docs for a full list of options
- global : list of global variables
- options : list of jslint options
- 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:
-
-
- js
var a = { a: 5, b: 6 }
This mode may break your scripts, so beware\! - e.g when returning an object literal.
- 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.