If you are used to using Notepad for general text and script editing, or perhaps have upgraded to some of the other 3rd party text editors, I’d like to introduce you to SciTE. It truly is an excellent all-round text editor, with a quick start-up time (essential), and support for script highlighting and compiling.
Read on for an overview of some of the key benefits of this excellent app.
Script, compile and deliver.
I first came across SciTE as part of the excellent AutoIT bundle, and not only use it for AutoIT coding now, but also for all of my text editing requirements, especially with very large files. If you already code in another scripting language, you may just want to start with a fresh download from the main Scite page. Whilst SciTE did not start out life designed to be a full integrated development environment (IDE), it certainly delivers.
Start writing your script as you would, and then select the language you are writing in from the Language menu. As well as selecting the language type from the drop down menu, you can also just simply save your script with the right extension, and SciTE will auto-format appropriately.
My language isn’t there.
If you program in a scripting language that isn’t listed for syntax highlighting, you can always change or adapt the rules, as they are simply text files defining the editor’s behaviour. The whole application configuration is handled using plain text files — not surprising when it is a text file editor, I guess. There may even be a mention of your desired language in the Global Options file, but has been commented out to keep menus to a reasonable length.
One of the first things I would recommend, is to open the Global options file, and remove the # to uncomment out the position.maximize=1, so that SciTE starts maximised each time. There are other options worth exploring in the Global options file, perhaps you can recommend some changes you have found useful in the comments below?
Example of syntax highlighting.
Let’s have a quick look at some examples of script syntax highlighting, and compiling scripts into the output window. Once you have written a sample script, you can see as you type that there is also built-in help for the individual commands in your scripting language. Here is a simple “Hello World” AutoIT script that I’ve typed, save as a .AU3 file, and the pressed F5 (Tools / Go):
Considering the small installer size and quick start—up that SciTE has, this is a remarkably quick way to script, compile and view the output. Simple scripts are one thing, though, but what if you are writing much larger projects? Well, this is where I think SciTE comes into its own. Using code folding, you can see the logic of each section of your file by expanding and contracting the code sections into their individual parts:
Here, the individual Case statements are hidden to that you can quickly skip through the main logic of the IF loop. Folding can be nested too, so that you can fold down smaller sections that are indented further, yet still retain an overall view of the main script. Folds can be toggled en-masse from the View menu. You can also see from this screenshot further syntax highlighting including comments shown in a light green italic font.
Help on hand
One of the things I always keep to hand is a copy of the scripting syntax. Using the AutoIT build of SciTE, I can simply begin typing the command I want to use, and I am prompted with the parameters for that command, much like a regular IDE might do. If I need further help, pressing F1 while next to the desired command invokes the full help menu:
This tight integration of SciTE with AutoIT is also available with other scripting languages, and many in the scripting community have developed their own installers with the appropriate links and options already available to make life easier.
Rapid search and replace.
As a general text editor, SciTE also improves upon simple functions that you may have used notepad for. A good example is the search and replace function. I took a file of several hundred lines and asked Notepad to replace one word with another. It happens quite slowly, but in SciTE the change is almost immediate. Search and replace has also been extended to include regular expressions in SciTE.
If you have a complex search and replace to do, perhaps something that you may have scripted using Perl or Python, you can now enter your regular expression directly into SciTE’s search and replace box, and perform the changes immediately.
SciTE is a free, ultra portable script editor that has many advanced features, including code folding, support for many scripting languages and other advanced features such as REGEX search and replace. It starts exceptionally fast, which is essential if you are to use this as a day—to—day editor. With integration with many scripting languages, code can be written, syntax checked and compiled with immediate view of the output. Its tabbed browsing display allows many files to be open at any one time, and it can deal with large files (and changes to these large files) with ease.
The integration with immediate code parameter help and full help at the touch of F1 makes scripting especially easy and seamless, so you can get on thinking about what you want your script to do, rather than where you must now import, compile and test the resulting code. Exceptionally easy to use, free, and a recommended daily utility.