moltenform
Home
Previous: Glacial Backup
Previous: Glacial Backup
SciTE-with-Python
SciTE-with-Python
Next: Microsoft
Next: Microsoft

Back

Configuration files

SciTE is configured by editing plain text files. Press Ctrl+; to open the "global properties" file. The lines that begin with # are comments and take no effect. The line tabbar.visible=1 means that the property "tabbar.visible" is set to 1; generally 1 means true/enabled and 0 means false/disabled.

Press Ctrl+Shift+; to open the "user properties" file, which is at first an empty file. You can edit this file and change properties (overriding anything set in global properties). As an example, if the line tabbar.visible=0 is added here, the file is saved, and SciTE is closed and reopened, the tab bar will not be visible.

If there is a file named SciTEDirectory.properties in the same directory as the file being edited, or in a parent directory, its changes will override those in user properties and global properties, and so properties to be customized on a per-directory basis.

If there is a file named SciTE.properties in the same directory as the file being edited, its changes will be applied.

When setting a property, one can refer to the value of another property by using the special syntax $(). If prop1=abc and prop2=$(prop1), then when prop2 is read it will get the value abc.

Setting up the Go command

When you click on Go from the Tools menu, or press F5, what action is taken? The answer depends on file extension. From the options menu choose Open ruby.properties. At the bottom of this file, notice the line "command.go.*.rb=ruby $(FileNameExt)" This tells SciTE that the command ruby should be run with the current file as an argument, if the current file extension matches *.rb.

For example, let's say we are in Windows and want Python scripts to run in Python 3.5 instead of Python 2.7. We choose Open python properties from the options menu. At the bottom of the file we see the line command.go.*.py=$(customcommand.externalpython) -u "$(FileNameExt)". We can change this to command.go.*.py=C:\python35\pythonw.exe -u "$(FileNameExt)".

On Windows if a Python script uses raw_input('prompt') to read from standard input, this works, you can type into the output pane and press Enter. Note that when you press Backspace, although visually the character is cleared, the Python script will not clear the character.

If you are writing code in C or C++, you might consider adding a SciTE.properties file in the directory with the line command.go.*=a.out (if the binary is named a.out). Pressing F7 will run 'make' by default, but can be configured by setting command.compile.*=(command).

Sending command line arguments

SciTE with Python adds to SciTE an easier way to pass command-line arguments (argv) to scripts. Once F5 is configured to run your script or binary, press Shift+F8 to open the Parameters dialog. After typing in a value in this dialog, pressing F5 in SciTE will pass it as a command-line argument. You can keep the dialog open; you don't need to click Set.

Customize keyboard bindings

The menukey.* settings allow the user to redefine keyboard bindings for menus. The syntax for the setting is: menukey.menu_title.menu_name=Modifier+Key

The File | Exit command could be specified as follows: menukey.file.exit=Ctrl+Shift+Q

Spaces in menu titles and names must be converted to underscores, and trailing ellipses removed. For example, "File | Save As...." is referenced as "menukey.file.save_as".

Use the special string "none" to remove a keyboard shortcut, as in, menukey.file.exit=none

Keyboard bindings can be further customized by setting user.shortcuts in a properties file, for example,

user.shortcuts=\
Ctrl+PageDown|IDM_NEXTFILE|\
Ctrl+L|SCI_LINEDELETE|

Note the required backslashes at the end of the line. The list of available IDM_ commands can be seen here. To use a Scintilla key command from this page, convert to uppercase and add the prefix SCI. For example, to make Ctrl+Shift+Q be a shortcut for moving to the end of the document, CommandValues.html lists DocumentEnd, and so in user.shortcuts you would add Ctrl+Shift+Q|SCI_DOCUMENTEND|.

See the section on writing plugins to see how keyboard bindings for tools can be added or edited.

(If you've customized your keyboard bindings and would like to see a summary of current bindings, look at the SciTE-with-python source code and find src/scite/scite/scripts/ShowBindingsForSciTEPython.py. Follow the instructions in the comment at the top of this script and it will read your .properties files and generate an html summary.)

Some of the new properties unique to SciTE-with-Python

More information

SciTE Documentation

SciTE FAQ

 

Back