SciTE |
Text editing in SciTE works similarly to most Macintosh or Windows editors with the added feature of automatic syntax styling. SciTE will only edit one file at a time, but does list recently opened files on the File menu making it easier to open recent files. Rectangular regions of text can be selected in SciTE by holding down the Alt key on Windows or the Ctrl key on GTK+ while dragging the mouse over the text.
There are two panes in SciTE, the editing pane and the output pane. The output pane is located either to the right of the editing pane or below it. Initially it is of zero size, but it can be made larger by dragging the divider between it and the editing pane. The Edit | Vertical Split command can be used to move the output pane beneath the editing pane.
SciTE can perform commands to compile or run source files with the output from these commands directed into the output pane.
For example, if Python is installed on the machine, open a new document, type:
print "Hi"
as that document's text.
Save the document as printhi.py.
print
"hi"
Perform the Tools | Go command.
>python -u printhi.py
hi
>Exit code: 0
The first blue line is from SciTE showing the command it will use to run the program. The black
line is the output from running the Python program. The last blue line is from SciTE showing
that the program has finished and displaying its exit code. An exit code of zero indicates a
successful run. SciTE partially understands the error messages produced by Python, GCC, Visual C++, Borland C++ and other tools which use the same format as one of these. To see this, add a mistake to the Python file by adding a second line to make the file:
print
"hi"
mistake
Perform the Tools | Go command. The results should look like:
>python -u printhi.py hi Traceback (innermost last): File "printhi.py", line 2, in ? mistake NameError: mistake >Exit code: 1
While it is easy to see where the problem is in this simple case, when a file is larger the Tools | Next Message command can be used to view each of the reported errors. Upon performing Tools | Next Message, the first error message in the output pane is highlighted with a yellow background, and an error indicator is displayed for the appropriate line in the editing pane. The caret is moved to this line and the pane is scrolled if needed to show the line. SciTE now looks like this:
SciTE understands both the file name and line number parts of error messages in most cases so can open another file (such as a header file) if errors were caused by that file. This feature may not work where the file name is complicated by containing spaces or ".."
If command execution has failed and is taking too long to complete then the Tools | Stop Executing command can be used.
On Windows, SciTE defaults to executing tools as command line programs. Executing a GUI program in this mode results in that program being run without displaying a window. The command.subsystem option can be used to define tools that run in GUI mode. The default subsystem, 0, is for command line programs, 1 is for programs which create their own windows, and 2 is for using the ShellExecute call. ShellExecute is a good way to open HTML files and similar as it handles this similarly to a user opening the file from the shell. 3 is for calling an internal extension, 4 is for calling the Windows specific HtmlHelp program and 5 is for calling the Windows specific WinHelp function.
Command line arguments to SciTE include file names, commands and properties.
Commands and properties are preceded by "-" and are differentiated by the use in
commands of ':' as the first character that is not '.' or alphabetic.
Properties use the syntax used in property set files and override any
properties set in property files. If there is no value given for a property, it is set to 1.
Double quotes
may be placed around arguments that contain spaces. On Linux, the standard shell
quoting is available. The "-p" argument causes SciTE to print the file and then exit.
For example,
SciTE "-font.base=font:MS Gothic,size:11" -save.recent ScintillaGTK.cxx
starts SciTE, opens ScintillaGTK.cxx, loads the recent file list, and uses
11 point MS Gothic as the base font.
A group of properties can be saved as a property set file (with the extension
".properties") and the import command used on the command line:
SciTE "-import c:\os\web_work" SciTEDoc.html
A few commands are currently available although this will expand in the future. These commands are available:
Command | Argument |
---|---|
close: | |
cwd: | change working directory |
find: | search text |
goto: | line number |
open: | file name |
quit: | |
replaceall: | search text\000replacement text |
saveas: | file name |
Commands use C style escape sequences which include:
Escape Sequence | Meaning |
---|---|
\\ | backslash |
\a | bell |
\b | backspace |
\f | form feed |
\n | new line |
\r | carriage return |
\t | tab |
\v | vertical tab |
\<ooo> | octal number specified by 1, 2, or 3 digits |
\x<hh> | hexadecimal number specified by 2 digits |
SciTE -open:/big/icon.txt
SciTE -open:"C:\\Program Files\\SciTE\\SciTEDoc.html" -goto:123
Command line arguments are evaluated left to right in two phases because opening files requires the user interface to be available and there is also a need to set some user interface properties before the user interface is displayed. The first phase process arguments until just before the first file name would be opened. The second phase processes the remaining arguments.
So, if you need to perform e.g. a find: or a goto: command on a file, you must put the command after the filename, to allow SciTE to open the file before performing the command.
SciTE may be configured to use between 1 and 10 buffers each containing a file. The default is 1 and this effectively turns off buffers. With more than one buffer, the Buffers menu can be used to switch between buffers, either by selecting the file name or using the Previous (F6) and Next (Shift+F6) commands.
When all the buffers contain files, then opening a new file causes a buffer to be reused which may require a file to be saved. In this case an alert is displayed to ensure the user wants the file saved.
A session is a list of file names. You can save a complete set of your currently opened buffers as a session for fast batch-loading in the future. Sessions are stored as plain text files with the extension ".ses".
Use File | Load Session and File | Save Session to load/save sessions. You can turn on/off "last session autoloading" using SciTE properties variable "save.session".
If "buffers" variable is set to "0" session management is turned off.
Loading previously saved session will close your currently opened buffers. However you will not loose your edits, because you will be asked to save unsaved buffers first.
Opening a specific file from command line overrides "save.session" variable state. When you start SciTE loading a specific file from command line last session will not restore even if "save.session" variable is set to "1". This makes "save.session" safe to use - you will never open a couple of files when you are trying to open just one, specific file.
SciTE currently is able to syntax style these languages:
Running and building commands for some of these languages have been set up but should be checked as they will have to be modified to work for many people.
Language settings are determined from the file extension but this can be changed by selecting anothr language from the Language menu. The language menu can be changed with the menu.language property.
SciTE has options to allow searching for words, regular expressions, matching case, in the reverse direction, wrapping around the end of the document. C style backslash escapes which are listed in the command line arguments section, may be used to search and replace control characters. Replacements can be made individually, over the current selection or over the whole file. When regular expressions are used tagged subexpressions can be used in the replacement text.
SciTE supports basic regular expressions with tagging.
Keyboard commands in SciTE mostly follow common Windows and GTK+ conventions. Keyboard equivalents of menu commands are listed in the menus. Some less common commands with no menu equivalent are:
Magnify text size | Ctrl+Keypad+ |
Reduce text size | Ctrl+Keypad- |
Restore text size to normal | Ctrl+Keypad/ |
Cycle through recent files | Ctrl+Tab |
Indent block | Tab |
Dedent block | Shift+Tab |
Delete to start of word | Ctrl+BackSpace |
Delete to end of word | Ctrl+Delete |
Delete to start of line | Ctrl+Shift+BackSpace |
Delete to end of line | Ctrl+Shift+Delete |
Expand or contract a fold point. | Ctrl+Keypad* |
Create or delete a bookmark. | Ctrl+F2 |
Go to next bookmark. | F2 |
Find selection. | Ctrl+F3 |
Find selection backwards. | Ctrl+Shift+F3 |
Scroll up. | Ctrl+Up |
Scroll down. | Ctrl+Down |
Line cut. | Ctrl+L |
Line transpose with previous. | Ctrl+T |
Find preprocessor conditional. | Ctrl+K |
Select to preprocessor conditional. | Ctrl+Shift+K |
Find preprocessor conditional backwards. | Ctrl+J |
Select to preprocessor conditional backwards. | Ctrl+Shift+J |
To use an abbreviation, type it and use the Expand Abbreviation command or the Ctrl+B key. The abbreviation is replaced by an expansion defined in the Abbreviations file. You can open the Abbreviations file with a command in the Options menu and add abbreviations.
Each line in the files looks like "abbreviation=expansion". An expansion may contain new line characters indicated by '\n' and a caret position indicated by the '|' character. Some simple examples are included in the distributed Abbreviations file.
SciTE supports folding for Python, HTML/XML, Pascal, and C++/C/Java/JavaScript. Fold points are based upon indentation for Python and on counting braces for the other languages. The fold point markers can be clicked to expand and contract folds. Ctrl+Shift+Click in the fold margin will expand or contract all the top level folds. Ctrl+Click on a fold point to toggle it and perform the same operation on all children. Shift+Click on a fold point to show all children.
Much of SciTE's behaviour can be changed by editing the properties files.
There are three properties files used, a global properties file called "SciTEGlobal.properties", a per user file called "SciTEUser.properties" (with a dot for the GTK+ version: ".SciTEUser.properties") and a local one called "SciTE.properties" which may be present in the same directory as the file being edited. On Windows, both the global and user properties files are in the directory of the executable. For GTK+ the user properties file is found in the user's home directory and the global properties in a directory set at build time - normally /usr/share/scite. If the "SciTE_HOME" environment variable is set on either Windows or GTK+ then it is where both the global and user properties files are found. Settings in the local properties file override those in the user properties file which override those in the global properties files.
The user properties file is intended for customisation by the user, leaving the global properties file to contain the default options distributed with SciTE. The main use of the local properties files is to change the effects of the Compile, Build and Go commands for the files in a directory. For example, I use the javac compiler from the Java Development Kit for most work, so SciTEGlobal.properties sets the command for compiling .java files to "javac". If I want to use the jvc compiler for the files in one directory, then the SciTE.properties file in that directory contains an entry setting the command to "jvc".
There are commands in the Options menu for opening each of the properties files.
The files are in approximately the same format as Java properties files which have a simple text format. Lines that start with '#' or that are completely blank are comments. Other lines are of the form
variable=value
For long values, a '\' character at the end of the line continues that value on the next line. Values may include the values of other variables by using $(variablename). There are some variables set by the environment to access the name of the current file as well:
FilePath is the full path of the current file.
FileDir is the directory of the current file without a trailing slash.
FileName is the base name of the current file.
FileExt is the extension of the current file.
FileNameExt is $(FileName).$(FileExt).
CurrentSelection is the value of the currently selected text but not if selection is
more than 1000 characters.
CurrentWord is the value of word which the caret is within or near.
SciteDefaultHome is the directory in which the Global Options file is found.
SciteUserHome is the directory in which the User Options file is found.
Some features use file name patterns to see which variable to use. For example, the lexer
variable can be specialised for a particular file, or a group of files based upon wildcard
matching so:
lexer.makefile=makefile indicates that the lexer called "makefile" should be used on
files called "makefile".
lexer.*.cxx=cpp indicates that the lexer called "cpp" should be used on files with a
"cxx" extension.
Variable substitution is available on the left hand side of file pattern assignments and
look like this:
file.patterns.html=*.html;*.htm;*.asp;*.shtml
command.go.$(file.patterns.html)=file://$(FilePath)
The 'import' statement includes a properties file as if the text were inline at that point. The imported properties file must be in the same directory as the current file and a .properties extension is assumed. Therefore a "import Lua" statement in c:\os\scite\bin\SciTEGlobal.properties will import c:\os\scite\bin\Lua.properties.
The 'if' statement takes one argument which is a symbol that may be defined earlier in this property set file or in a base property set. If the symbol evaluates to '0' then the test fails. An empty string or not present symbol evaluates to 0. Into the very top property set is inserted one of 'PLAT_GTK' with value '1' or 'PLAT_WIN' with value '1'. If the test succeeds then following indented statements are executed. When a non-indented statement is found the if clause is finished. Only simple set statements are allowed in if clauses. The evaluation of if statements occurs at read time, not at evaluation time.
SciTE has 4 properties $(1) .. $(4) which can be used to run commands with changeable parameters. To set the parameter values, use the View | Parameters command to view the modeless Parameters dialog which shows the current values of these parameters and allows setting new values. The accelerator keys for the main window remain active while this dialog is displayed, so it can be used to rapidly run a command several times with different parameters. Alternatively, a command can be made to display the modal Parameters dialog when executed by starting the command with a '*' which is otherwise ignored. If the modeless Parameters dialog is already visible, then the '*' is ignored.
Some properties are only available on Windows or GTK+.
position.left position.top position.width position.height |
Set the initial window size and position. If these are omitted or set to 0 then the environments defaults are used. If the width or height are -1 then the window is maximised. |
buffers |
Set to a number between 1 and 10 to configure that many buffers.
Values outside this range are clamped to be within the range.
The default is 1 which turns off UI features concerned with buffers. This value is read only once, early in the startup process and only from the global properties files. So after changing it, restart SciTE to see the effect. |
are.you.sure are.you.sure.for.build |
The classic GUI question. Normally, when SciTE is about to close a file which has unsaved
edits it asks this annoying question. To turn off the question, set are.you.sure to 0 and
files will be automatically saved without bothering the user. To abandon edits to a file
use the New command. New always asks "Are you sure?" giving an opportunity to not save
the file. When running or building a file, its most likely that you want the file to be saved first. To enable a confirmation dialog for performing commands in the Tools menu, set are.you.sure.for.build=1. |
view.whitespace view.indentation.whitespace |
Setting view.whitespace to 1 makes SciTE start up with whitespace visible. Setting view.indentation.whitespace to 0 hides visible whitespace inside indentation. |
view.indentation.guides highlight.indentation.guides |
Setting view.indentation.guides to 1 displays dotted vertical lines within indentation white
space every indent.size columns. Setting highlight.indentation.guides to 1 highlights the indentation guide associated with a brace when that brace is highlighted. |
view.eol | Setting this to 1 makes SciTE display the characters that make up line ends. This looks similar to (CR), (LF), or (CR)(LF). This is useful when using files created on another operating system with software that is picky about line ends. |
eol.mode |
The default EOL mode (characters that make up line ends)
depends on your platform.
You can overwrite this behaviour by setting the property to
LF for UNIX format CR for Macintosh format CRLF for DOS/Windows formatAs you see, Windows combines the best of the other worlds ;-) |
eol.auto | This setting overrides the eol.mode value and chooses the end of line character sequence based on the current contents of the file when it is opened. The line ending used the most in the file is chosen. |
blank.margin.left blank.margin.right |
There is a blank margin on both sides of the text. It is drawn in the background colour of default text. This defaults to one pixel for both left and right sides but may be altered with these settings. |
margin.width | Setting this to a number makes SciTE display a selection margin to the left of the text. The value is the number of pixels wide the selection margin should be. Line markers are displayed in the selection margin area. |
full.screen.hides.menu | Setting this to 1 hides the menu bar when the Full Screen command is used on Windows. On GTK+ the menu is always visible. |
minimize.to.tray | Setting this to 1 minimizes SciTE to the system tray rather than to the task bar. |
line.numbers | Setting this to a number makes SciTE start up with a column of line numbers displayed to the left of the selection margin. The value is the number of pixels wide the line numbers can be so make it something like 30, do not make it 1. Setting line.numbers to 1 is the most frequent SciTE support request. |
tabbar.visible tabbar.hide.one |
Setting tabbar.visible to 1 makes the tab bar visible at start up on Windows. The buffers property must be set to a value greater than 1 for this option to work. Setting tabbar.hide.one to 1 hides the tab bar until there is more than one tab. |
tabbar.multiline | Setting tabbar.multiline uses multiple lines for the tab bar |
toolbar.visible | Setting this to 1 makes the tool bar visible at start up. |
statusbar.visible | Setting this to 1 makes the status bar visible at start up. |
statusbar.number statusbar.text.number |
The statusbar.text.1 option defines the information displayed in the status bar by default. Property values may be used in this text using the $() syntax. Extra properties defined for the status bar are LineNumber, ColumnNumber, and OverType which is either "OVR" or "INS" depending on the overtype status. On Windows only, further texts may be set as statusbar.text.2 ... and these may be cycled between by clicking the status bar. The statusbar.number option defines how many texts are to be cycled through. |
statusbar.size | On Windows only, sets the width in pixels of the status bar text. |
use.palette | Setting this to 1 makes SciTE use a palette to enable it to display more colours on 8 bit displays. Without this option SciTE will only display with colours already available which is normally the 20 colour Windows system palette. The downside of turning on this option is that there will be some flashing as windows are activated. This option has no effect on GTK+ where a palette is always used. |
buffered.draw | Setting this to 0 rather than the default 1 makes SciTE draw output directly to the screen rather than into a buffer bitmap first and then to the screen. Buffered drawing flickers less but is slower. |
load.on.activate save.on.deactivate |
The load.on.activate property causes SciTE to check whether the current file has been
updated by another process whenever it is activated. This is useful when another editor
such as a WYSIWYG HTML editor, is being used in conjunction with SciTE. The save.on.deactivate property causes SciTE to save the file whenever the SciTE application loses focus. This is useful when developing web pages and you want to often check the appearance of the page in a browser. |
check.if.already.open | When this option is set and SciTE is started, it checks to see if there are any other instances of SciTE open. If there is, another instance is activated and this one exits. On GTK+ the instance with the file already open as the command line argument is switched to. On Windows an arbitrary instance is chosen and asked to open the command line argument. |
selection.fore selection.back |
Sets the colours used for displaying selected text. If one of these is not set then that attribute is not changed for the selection. The default is to show the selection by changing the background to light grey and leaving the foreground the same as when it was not selected. |
caret.fore | Sets the colour used for the caret. |
caret.line.back | Sets the background colour used for line containing the caret. |
caret.period | Sets the rate at which the caret blinks. The value is the time in milliseconds that the caret is visible before it is switched to invisible. It then stays invisible for the same period before appearing again. A value of 0 stops the caret from blinking. |
caret.width | Sets the width of the caret in pixels. Only values of 1, 2, or 3 work. |
caret.policy.strict caret.policy.slop caret.policy.lines caret.policy.xeven caret.policy.xjumps |
Determines how the display area follows the caret. If slop is set then the value of caret.policy.lines is used to determine the number of lines at the top and bottom of the display area that make up the "unwanted zone" where the caret should not appear if possible. There is also an horizontal unwanted zone of 50 pixels at the left and right of the display area. When strict is set then the caret is not allowed to move into the unwanted zone. Caret policy is then rechecked even if the caret is completely visible. When strict is not set then the caret is allowed into this zone but when it does go out of the display area, then the display area is repositioned so the caret is not in the unwanted zone. If slop is not set then the area is centred around the caret, with strict determining if this centring is maintained at all times or if it is performed only when the caret is not completely visible. If caret.policy.xeven is set then both the left and right margins are treated equally whereas if it is not set then displaying text to the left is preferred. If caret.policy.xjumps is set then the display is not horizontally repositioned until the caret reaches themargin at which time the display jumps to ensure the caret is not within the unwanted area. f caret.policy.xjumps is not set then the caret stays out of the unwanted area causing more but smaller movements. Default: caret.policy.slop=1, all others = 0. |
visible.policy.strict visible.policy.slop visible.policy.lines |
Determines how the display area is determined after a Go to command or equivalent such as a Find or Next Message. Options are similar to caret.policy.*. |
edge.mode edge.column edge.colour |
Indicates long lines. The default edge.mode, 0, does not indicate long lines. An edge.mode of 1 uses a vertical line to indicate the specified column and an edge.mode of 2 changes the background colour of characters beyond that column. For proportional fonts, an edge.mode of 2 is more useful than 1. |
error.marker.fore error.marker.back |
The colours used to indicate error and warning lines in both the edit and output panes are set with these two values. If there is a margin on a pane then a symbol is displayed in the margin to indicate the error message for the output pane or the line causing the error message for the edit pane. The error.marker.back is used as the fill colour of the symbol and the error.marker.fore as the outline colour. If there is no margin then the background to the line is set to the error.marker.back colour. |
strip.trailing.spaces | Strips trailing white spaces from the file while saving. |
api.filepattern |
Loads an API file for a particular language. API files contain a sorted list of
identifiers and function prototypes, one per line. The "Complete Identifier" command
looks at the characters before the caret and displayed the subset of the API file
starting with that string. When an opening brace is typed, the file is searched for the
text preceding the caret and if a function prototype is found then it is displayed as a
calltip.
For example, the setting
api.*.c=w.api could be used with a w.api file containing
fclose(FILE* fileClose) to provide autocompletion and calltips for some of the C file functions. It is best to use the full path to the API file as otherwise the current directory is used. See the Creating API files section for ways to create API files. |
autocomplete.choose.single | When set to 1 and an autocompletion list is invoked and there is only one element in that list then that element is automatically chosen. This means that the matched element is inserted and the list is not displayed. |
autocomplete.lexer.ignorecase autocomplete.*.ignorecase |
When set to 1 the API file is searched in a case insensitive way to find elements for autocompletion lists. Otherwise matches only occur if case also matches. The * form is used if there is no lexer specific setting. |
autocomplete.lexer.start.characters autocomplete.*.start.characters |
If this setting is not empty, typing any of the characters will cause autocompletion to start. For example, if autocomplete.python.start.characters=. and the API file for Python contains "string.rjust" and "string.replace" then typing "string." will cause the autocompletion to display both identifiers. The * form is used if there is no lexer specific setting. |
autocompleteword.automatic | If this setting is 1 then when typing a word, if only one word in the document starts with that string then an autocompletion list is displayed with that word so it can be chosen by pressing Tab. |
calltip.lexer.ignorecase calltip.*.ignorecase |
When set to 1 the API file is searched in a case insensitive way to find the function which will have its signature displayed as a calltip. The * form is use if there is no lexer specific setting. |
calltip.lexer.word.characters calltip.*.word.characters |
To determine the identifier to look up for calltips, a search is performed allowing the characters in this set to be included in the identifier. While the same setting can be used as for word.characters, sometimes additional characters may be allowed. For example, in Python, '.' is not normally considered part of a word when selecting text, but it is good to allow "string.replace" to show a calltip so calltip.python.word.characters=._$(chars.alpha) would be a reasonable setting. The * form is used if there is no lexer specific setting. |
calltip.back | Sets the colour used for the background of any calltips. The default is white. |
styling.within.preprocessor | For C++ code, determines whether all preprocessor code is styled in the preprocessor style (0, the default) or only from the initial # to the end of the command word(1). |
tab.timmy.whinge.level |
For Python code, checks whether indenting is consistent. The default, 0 turns off
indentation checking, 1 checks whether each line is potentially inconsistent with the
previous line, 2 checks whether any space characters occur before a tab character
in the indentation, 3 checks whether any spaces are in the indentation, and 4 checks
for any tab characters in the indentation. 1 is a good level to use. |
magnification output.magnification |
Sets the initial magnification factor of the edit and output panes. This is useful when you want to change the size of text globally, such as after changing the screen resolution without having to touch every style setting. 0 is default, negative values makes the size smaller and positive values make it larger. |
split.vertical output.horizontal.size output.vertical.size |
If split.vertical is set to 1 then the output pane is to the right of the editing pane, if set to 0 then the output pane is below the editing pane. The output.*.size settings determine the initial size of the output pane. |
clear.before.execute | If set to 1 then the output pane is cleared before any tool commands are run. |
horizontal.scrollbar output.horizontal.scrollbar output.scroll |
If horizontal.scrollbar set to 0 then the edit pane's horizontal scrollbar is not displayed. Similarly, output.horizontal.scrollbar controls the scroll bar of the output pane. To stop the output pane from automatically scrolling, set output.scroll to 0. |
open.filter | This is a complex expression used for determining the file types that will be available in the open file dialog. For each type of file, there is some explanatory text, a '|' character, some file patterns, and another '|' character. In the distributed SciTEGlobal.properties file, the line continuation character '\', is used to spread these items out, one per line. These file types appear in the "Files of type:" pull down. The first item is the default, so you may wish to change the first item to include the file types you commonly open. This option has no effect on GTK+ where a filter of * is always in effect. |
save.deletes.first | Causes files to be deleted before being opened for saving. Can be used on Windows to ensure saving under a different capitalisation changes the files capitalisation rather than silently using the old capitalisation. |
save.recent save.session |
Setting save.recent causes the most recently used files list to be
saved on exit and
reloaded at start up. This list is kept in a file called "SciTE.recent" on
Windows and ".SciTE.recent" on GTK+ and is located in the directory
given by the SciTE_HOME environment variable and if that is not
set, the value of the HOME environment variable and if that is not
set the top level directory. If you set "save.session=1", current session will be automatically saved to a file "SciTE.ses" on Windows and ".SciTE.ses" on GTK+ located at the same place as "SciTE.recent" file. When you start SciTE next time the last session will be automatically loaded. |
open.dialog.in.file.directory | Setting open.dialog.in.file.directory causes the open dialog to initially display the same directory as the current file. If it is not set then the system default is used which on Windows 2000 is the last directory visited by the open dialog in any instance of SciTE. This is hard to use with multiple instances of SciTE. |
find.replace.matchcase find.replace.regexp find.replace.wrap find.replace.escapes |
These properties define the initial conditions for find and replace commands. The find.replace.matchcase property turns of the "Match case" option, find.replace.regexp the "Regular expression" option, find.replace.wrap the "Wrap around" option and find.replace.escapes the "Transform backslash expressions" option. |
find.command | The Find in Files command works in a similar way to the building commands executing a command line tool with output redirected to the output pane. If the command produces output understood by one of the error output passes, as does grep, then the F4 and Shift+F4 keys can be used to move through all the matches. The $(find.what) and $(find.files) variables can be used to use the values from the Find in Files dialog. |
find.files | This is the default set of files to search through using the Find in Files command. |
code.page |
To support a DBCS language such as Japanese, a code page can be set here. This ensures
that double byte characters are always treated as a unit so the caret is never located
between the two bytes of a double byte character. This option has no effect on GTK+ where
SciTE only supports single byte character sets. On Windows, setting code.page to 65001 starts Unicode mode and the document is treated as a sequence of characters expressed as UTF-8. Display is performed by converting to UCS-2 first so characters from any language will be displayed. Correct glyphs will only be displayed if fonts are chosen that contain the appropriate glyphs. Tahoma is a good choice on Windows 2000. |
character.set | This setting allows changing the character set that is asked for when setting up fonts. To use Russian Cyrillic characters, set character.set to 204. Other values that may work include Chinese (134 or 136), Korean (129), Greek (161), Eastern European (234), Baltic (186), Turkish (162), Hebrew (177), Arabic (178), Thai (222), or Japanese (128). All of these values may work on Windows, but on GTK+ Baltic, Turkish, Thai and Vietnamese will probably not work. Please send email if you use one of these settings and it works or doesn't or if you have information on how to support other languages. |
comment.block.lexer comment.block.at.line.start.lexer comment.stream.start.lexer comment.stream.end.lexer comment.box.start.lexer comment.box.middle.lexer comment.box.end.lexer |
These settings are for the comment commands in the Edit menu and are
defined separately for each lexer. Not all languages support
both stream and block comments. Block comments are comments that start with a particular string and continue until the end of line. The comment.block property sets the string to be inserted or deleted at the start of the selected lines when the Block Comment or Uncomment command is performed. To make this command perform sensibly over a range of text that already contains comments and other code, the string can be defined to contain a character such as '~' that is not used in real comments. Set comment.block.at.line.start to "1" to place block comment symbols at the start of the lines, instead of just before the first non-blank character of the lines. Stream comments start with a particular string and end with another particular string and may continue over line ends. These are defined with comment.stream.start and comment.stream.end. Box comments are a form of stream comment that takes several lines and uses different strings for the start, end and other lines in the range. These are defined with comment.box.start, comment.box.middle and comment.stream.end. |
preprocessor.symbol.filepattern preprocessor.start.filepattern preprocessor.middle.filepattern preprocessor.end.filepattern |
These settings make the preprocessor conditional movement and selection commands work. The character that defines preprocessor lines is defined by preprocessor.symbol. The preprocessor keywords that make up the start (if), middle (else), and end (endif) of preprocessor conditionals are defined by the other three properties. There may be multiple values for each of these, as, for example, C uses "if", "ifdef", and "ifndef" to begin preprocessor conditionals. |
lexer.filepattern | A lexer splits a file up into syntactic pieces. SciTE can then display these pieces in different visual styles. Several lexers are available in SciTE for some of the popular programming languages such as Python, Java, C/C++, JavaScript and VB. Often several file extensions (.cpp, .cc, .h) can map to one language (C++) and hence one lexer. These settings associate a file name with a lexer. |
keywords.filepattern keywords2.filepattern keywords3.filepattern keywords4.filepattern keywords5.filepattern keywords6.filepattern keywordclass.lexer |
Most of the lexers differentiate between names and keywords and use the keywords
variables to do so. To avoid repeating the keyword list for each file extension, where
several file extensions are used for one language, a keywordclass variable is defined in
the distributed properties file although this is just a convention. Some lexers define a
second set of keywords which will be displayed in a different style to the first set of
keywords. This is used in the HTML lexer to display JavaScript keywords in a different
style to HTML tags and attributes. Keywords can be prefix based so ^GTK_ will treat all words that start with GTK_ as keywords. |
default.file.ext | Defines the language mode used before the file has a name. For example, if default.file.ext=.py, then when the New command is used to create a new file then Python syntax styling is used. |
word.characters.filepattern | Defines which characters can be parts of words. The default value here is all the alphabetic and numeric characters and the underscore which is a reasonable value for languages such as C++. |
style.*.stylenumber style.lexer.stylenumber |
The lexers determine a style number for each lexical type, such as keyword, comment or
number. These settings determine the visual style to be used for each style number of
each lexer. The value of each setting is a set of ',' separated fields, some of which have a subvalue after a ':'. The fields are font, size, fore, back, italics, notitalics, bold, notbold, eolfilled, noteolfilled, underlined, notunderlined, and case. The font field has a subvalue which is the name of the font, the fore and back have colour subvalues, the size field has a numeric size subvalue, the case field has a subvalue of 'm', 'u', or 'l' for mixed, upper or lower case, and the bold, italics and eolfilled fields have no subvalue. The value "fore:#FF0000,font:Courier,size:14" represents 14 point, red Courier text. A global style can be set up using style.*.stylenumber. Any style options set in the global style will be inherited by each lexer style unless overridden. |
style.lexer.32 style.lexer.33 style.lexer.34 style.lexer.35 style.lexer.36 style.lexer.37 |
As well as the styles generated by the lexer, there are other numbered styles used. Style 32 is the default style and its features will be inherited by all other styles unless overridden. Style 33 is used to display line numbers in the margin. Styles 34 and 35 are used to display matching and non-matching braces respectively. Style 36 is used for displaying control characters. This is not a full style as the foreground and background colours for control characters are determined by their lexical state rather than this style. Style 37 is used for displaying indentation guides. Only the fore and back are used. A * can be used instead of a lexer to indicate a global style setting. |
braces.check braces.sloppy style.lexer.34 style.lexer.35 braces.lexer.style |
Brace highlighting is a feature that shows the range of a brace when the caret is positioned immediately after it. It is especially useful when complex nested braces are used. The characters '(', ')', '[', ']', '{', and '}' are considered braces. The feature defaults to off (because it slows cursor movement) unless braces.check is set to 1. If braces.sloppy is set to 1 then if there is no brace before the caret then the character after the caret is checked. The highlighting is performed by displaying the braces in style number 34 or in style number 35 if there is no matching brace. While this is a full style, to avoid partial display of the braces, it is best to make this style differ from the standard style of braces only in foreground and background colour. Only braces with style set to braces.lexer.style (which defaults to 0) are candidates for brace match highlighting. |
font.monospace | Defines, with the same syntax as the style properties, the font name and size to be used when the Use monospaced font command is performed. |
command.compile.filepattern command.compile.subsystem.filepattern command.build.filepattern command.build.subsystem.filepattern command.build.directory.filepattern command.go.filepattern command.go.subsystem.filepattern |
These settings choose which commands to execute when the Compile, Build or Go menu items
are selected. The subsystem options determine for Windows whether the tools are run as
command line(0), windowed(1), or through ShellExecute(2). When source files are in a different directory to that they should be built in, the command.build.directory property can be set to change to a particular directory before performing the build. |
command.go.needs.filepattern command.go.needs.subsystem.filepattern |
Sometimes a file must be compiled or built before it can be run. If this is the case,
this setting indicates what command needs to be run to perform the compile or build step
before running the file. When a file is compiled, this is noted and future runs will not
perform a compile or build. To make a 'compile and go' Go command for .c files:
command.go.*.c=$(FileName)
|
command.name.number.filepattern command.number.filepattern command.is.filter.number.filepattern command.subsystem.number.filepattern |
Extra commands can be added to the Tools menu. For example to include the 'astyle'
indenter, the properties file could contain
command.name.0.*.cc=Indent The first line defines the string that will appear in the Tools menu (immediately below 'Go'. The second line is the command string, similar to those of the compile, build, and go commands. The optional command.is.filter property states that the command modifies the current file so it may need to be read in after performing the command if load.on.activate is set. The subsystem determines how the command is executed on Windows. 0, the default is for command line programs, 1 for programs which create their own windows, 2 for running by using ShellExecute, 3 for running in an internal extension, 4 for running HtmlHelp on Windows, and 5 for running WinHelp on Windows. When using subsystem 4 or 5, the command has two parts separated by ! with the first part being the topic to search for and the second the name of the help file. If the text of a command starts with '*' then the Parameters dialog is displayed to prompt for parameters before executing the command. The initial '*' is not included in the command that is executed. |
command.help.filepattern command.help.subsystem.filepattern |
Defines a command to be executed when the help command is invoked or F1 pressed. On Windows, this often uses subsystem 4 as described above. On Linux, running man or a browser are common ways of displaying help. The word at the cursor is copied to $(CurrentWord) and this is often a good argument to the help application. The subsystem property works in the same way as for other commands. |
win95.death.delay | On Windows 95, there can be a delay between a process completing and all of its piped output being available. By waiting this number of milliseconds, we can be sure to see all the output. Defaults to 500 but may need to be higher for slower machines. |
time.commands | When a command is completed, print the time it took in seconds. |
print.magnification | Printing is normally done with the same settings as screen display. To make the printing larger or smaller, the print.magnification setting is added to the size of every font when printed. To get a good miniaturisation of text, set print.magnification to -4. |
print.colour.mode | Some people prefer light coloured text on a black background on screen but dark text on white on paper. If print.colour.mode is set to 1 then each colour is inverted for printing. If set to 2 then printing produces black text on white background. 3 forces the background to white and 4 forces the default background to white. |
print.margins | Specify the default margins on the printer on Windows in left right top bottom order. Units depends on your locale, either hundredths of millimetres or thousandths of inches. You can see which units by the units used in the page setup dialog. This property is only read at start up. |
print.header.format print.footer.format |
These settings determine what will be printed if anything as headers and
footers. Property settings can be substituted into the values using the $(property)
syntax. There are some extra properties set up while printing:
CurrentPage, FileTime, FileDate, CurrentDate, and CurrentTime (at start of
printing).
Common properties to use in headers and footers are FileNameExt and FilePath. A header setting may look like:
print.header.format=$(FileNameExt) - Printed on $(CurrentDate),$(CurrentTime) - Page $(CurrentPage)
|
print.header.style print.footer.style |
These settings determine the style of the header and footer using the same format as other styles in SciTE. Only the fore, back, font, size, bold, italics, and underlined attributes are supported. |
export.keep.ext | This property determines how the file name (for example, LineMarker.cxx) is transformed when exporting to include the appropriate export format extension - .html for HTML and .rtf for RTF. If export.keep.ext is the default, 0, then the current extension is replaced (LineMarker.html). If it is 1, then the export format extension is added (LineMarker.cxx.html). If it is 2 then the final '.' is replaced by '_' and the export format extension added (LineMarker_cxx.html). |
export.html.wysiwyg export.html.tabs export.html.folding export.html.styleused export.html.title.fullpath |
When export.html.wysiwyg is set to 0 then exporting to a HTML file produces a smaller
file but which is less completely specified so may look more different to the on screen display.
When export.html.tabs is set to 1 and export.html.wysiwyg is set to 0 then tab characters in
the file are exported as tab characters rather than a sequence of space characters. The exported file can be made to fold in browsers that support CSS well (Mozilla and Internet Explorer) by setting export.html.folding to 1. Only export styles actually used when export.html.styleused set to 1. The full path name of the file is put in the title, instead of just the file name when export.html.title.fullpath set to 1. |
export.rtf.wysiwyg export.rtf.tabs export.rtf.font.face export.rtf.font.size export.rtf.tabsize |
When export.rtf.wysiwyg is set to 0 then exporting to a RTF file produces a smaller
file but which is less completely specified so may look more different to the on screen display.
When export.rtf.tabs is set to 1 and export.rtf.wysiwyg is set to 0 then tab characters in
the file are exported as tab characters rather than a sequence of space characters. export.rtf.font.face and export.rtf.font.size can be used to select a particular font and size for the exported RTF file. export.rtf.tabsize can be set to use a different tab size than that defined by the tabsize setting. |
fold fold.margin.width fold.symbols fold.on.open |
Options to control folding. Folding is turned on be setting fold to 1. The fold.symbols setting chooses between four ways of showing folding. Set to 0 (the default) for MacOS style arrows to indicate contracted (facing right) and expanded (facing down); 1 to display contracted folds with "+" and expanded with "-"; 2 for a flattened tree control with round headers and rounded joins; 3 for a flattened tree control with square headers. To automatically fold files as much as possible when loaded, set fold.on.open to 1. |
fold.compact |
For HTML, XML and C++ and similar files, turning this option on leads to blank lines following the end of an element folding with that element. Defaults to on. |
fold.html | Folding is turned on or off for HTML and XML files with this option. The fold option must also be on for folding to occur. |
fold.comment | This option enables folding multi-line comments when using the C++ lexer. |
fold.comment.python fold.quotes.python |
These options enable folding multi-line comments or quoted strings when using the Python lexer. |
title.full.path | Changes title of window to use the full path rather than just the file name. |
tabsize indent.size use.tabs use.tab.for.filepattern tab.indents backspace.unindents |
Sets the size of a tab as a multiple of the size of a space character in the style of the default style definition. The indent size is the size to use when performing automatic indentation and may be different from the tab size. Many people use a tab size of 8 but 4 character indentation. When creating indentation, use.tabs determines whether the indentation is made up purely from space characters or from a mix of tabs and spaces using as many tabs as possible. The default use.tabs property can be overridden for files that match a pattern by a use.tab.characters.filepattern property. If tab.indents set then pressing tab within indentation whitespace indents by indent.size rather than inserting a tab character. If backspace.unindents then pressing backspace within indentation whitespace unindents by indent.size rather than deleting the character before the caret. |
indent.automatic indent.opening indent.closing |
Determines the look of automatic indentation. Automatic indentation is turned on with
indent.automatic=1. To indent a brace line after a compound statement start set
indent.opening=1, likewise for the terminating brace. So with both set to 0:
if (c) And with both set to 1:
if (c)
|
statement.indent.filepattern statement.end.filepattern statement.lookback.filepattern block.start.filepattern block.end.filepattern |
Each of these settings starts with a style number and then a set of words or characters
that define how to recognise that feature. It there is second space in the setting then
it is a set of words, otherwise a set of characters. The set of keywords used to indicate
the start of a compound statement is defined in statement.indent. For example:
statement.indent.$(file.patterns.cpp)=5 if else while
says that for C++ the words "if", "else", and "while" in keyword style, 5, start compound statements which leads to the next line being indented if no other factors affect it. However, if a statement end is found on the same line then the next line is not indented. For C++ the statement end is the semicolon in the operator style, so this is defined:
statement.end.$(file.patterns.cpp)=10 ;
The number of lines looked at to determine indentation can be set with statement.lookback. This can be used either to bound the amount of time spent on this task or to specify that only the last line be examined for indentation. The block.start and block.end properties define the language elements used to bracket groups of statements. In C++ these are '{' and '}'. |
vc.home.key | Chooses the behaviour of the Home and Shift+Home keys. 1, the default is like Visual C++ moving the caret to the end of then line indentation unless already there, in which case it moves to the start of the line. 0 moves to the start of the line. |
warning.findwrapped warning.notfound warning.wrongfile warning.executeok warning.executeko warning.nootherbookmark |
Allows for sounds to be played and the window to be flashed
on Windows when particular events occur.
The values consist of three items separated by ',': flash duration, sound
and sound duration. If sound is a number then it is treated as a pitch and
played for the duration in milliseconds.
Otherwise it is treated as a path to a sound file
that is played. If you do not want a flash, specify 0 for flash duration.
For example,
warning.wrongfile=0,C:\Windows\Media\SFX\Glass.wav
will play the glass sound if open selected is given a bad file name. The findwrapped warning occurs when a find operation wraps past either end of the file, notfound when the find or preprocessor conditional move commands fail to find a match, executeok when a command such as build executes successfully, executeko when a command fails, and nootherbookmark when there is no bookmark to find. |
fileselector.width fileselector.height |
For the GTK+ version determines the initial size of the file selector dialog invoked by the Open and Save commands. Setting has no effect on Windows. |
translation.missing | When using a localised version, if a term is not found in the locale.properties translation file then use the value of translation.missing instead. By setting this to a marker such as "***" it is easier to check where terms have not been provided with translations. |
For languages very similar to existing supported languages, which may only differ in a minor feature such as the keywords used, the existing lexers can often be reused. The set of keywords can then be changed to suit the new language. Java and JavaScript could have reasonably reused the C++ lexer. The Java lexer was added only to support doc comments.
For languages that can not be lexed with the existing lexers, a new lexer can be coded in C++.
The open.filter should be modified to include the file extensions used for the new language and entries added for command.compile, command.build, command.go and command.go.needs for the language.
The .api files can be generated by hand or by using a program.
For C/C++ headers, an API file can be generated using ctags and then the tags2api Python script (which assumes C/C++ source) on the tags file to grab complete multiple line function prototypes. Some common headers surround parameter lists with a __P macro and may have comments. The cleanapi utility may be used on these files.
To generate an API file for Python modules, there is a gen_python script.
The menus and dialogs can be translated into another language by modifying the locale.properties file which should be stored in the same directory as the global properties.
The procedure for building and installing SciTE is described in the README file in the scite directory.
There are two formal extension interfaces for SciTE, the SciTE Extension Interface is for extending SciTE with code compiled into the SciTE executable and the SciTE Director Interface is for manipulating SciTE on Windows from another application.