Sciboo Sciboo is a extendable Scintilla-based programmer's editor that runs on .NET; it already has support for C/C++,C#,Python/Boo,Pascal,HTML and Fortran, and can run external compilers and process their output. I started the Sciboo project because I wanted to do a non-trivial Boo application, and (as these things go) it grew beyond what was strictly necessary. Boo is a Python-like language for .NET/CLI which is mostly statically-typed. Due to clever type-inference, one usually doesn't have to explicitly specify the types. Although it has a silly name and is still young, it is a powerful and expressive language; Sciboo is a nice environment for working with Boo. In fact, most Sciboo development has been done using Sciboo itself. But such implementation details are not be obvious to the user. The editor which Sciboo most resembles is Neil Hodgson's excellent SciTE, with separate buffers in tabs. Why another editor? There are hundreds of programmer's editors available! Sciboo is very powerful for its size, and tries to make using external compilers as easy as possible, without becoming a fullblown IDE. The emphasis is on _extendability_; any .NET language can be used to write plugins. Sciboo follows the standards set by Scintilla and SciTE, which are derived from Visual Studio. You can set bookmarks with Ctrl-F2, and move to the next bookmark with F2. If you are on a brace, then Ctrl-E will go to the matching brace. I've tried to keep the keyboard shortcuts consistent with SciTE. For example, F8 will toggle the output pane, i.e you can use it to hide or show program results, file searches, compiler output. Sometimes these shortcuts aren't so nice, but I've kept them anyhow, e.g. Ctrl-W to close a view. The Buffers menu gives you alternative access to all the views. A useful operation is 'Swop Top' (F11) which switches between the last two accessed views - you can get the same affect with Alt-B 2, since the buffers menu is kept in recently-used order. Alternatively, Ctrl- can be used to activate any of the first 9 views. Sciboo allows for creating new forms with Buffers|New Window. Forms can be tiled across the desktop. A very useful sequence for comparing two views side-by-side is Buffers|Move To Other followed by Buffers|Tile. This compensates somewhat for not having split windows. (Split windows would be hard to accomodate in the tabbed interface, which is why SciTE doesn't do them either.) File|Recent Files allows you to browse previously opened files. You can open a file by double-clicking it, or select a number of files using shift and control in the usual way, and press enter. The Find and Replace dialogs are panels attached to the bottom rather like Firefox. This allows minimal interference with search results. Rather than using the usual array of checkboxes, various kinds of search are specified by drop-down boxes. For instance, one can search in the current view, in the 'other' view (that is, a view in the other window), in all open buffers, in the output results, and finally, in all files of the same type as the current file. 'Quick Search' (Ctrl-F3) finds the word at the cursor (or the selection, if it's defined); Shift-F3 finds the word in the backwards direction. Unlike SciTE, file search results, program output and compiler output are in separate panes, selected with tabs. Navigating around Programs Sciboo supports bookmarks, using the Visual Studio convention; Ctrl-F2 to toggle, F2 to go to the next bookmark. Search|Show Bookmarks will show you all defined bookmarks in all views, together with the line text. This is a convenient way to mark places for easy return. You can _push a mark_ using Ctrl-M. Ctrl-J will then go back to the last mark pushed, and so on. All the find operations push the mark automatically, so you can easily get back to the start of your search using Ctrl-J. (Note that Ctrl-J works across views.) On the context menu ('Popup', right-click) there is 'Open File in Document'. This understands things like C and Fortran's include statements, Python and Boo's import statements, and HTML references of the form href="file#ref". You can use this to follow links in hypertext, providing the links are local. (Ctrl-Shift-O can be used as a keyboard shortcut) This release includes an interface to ctags, making it easy to navigate around large projects. You will have to download ctags (http://ctags.sourceforge.net) to use the ctags plugin. I've prepared a version which understands Boo (http://home.mweb.co.za/sd/sdonovan/ctags.zip). Run ctags on the files in the project, and add "ctags.file=\tags" to the appropriate .mode file. For example, create a tag file for all the C# files in a directory: c:\projects\csi> ctags *.cs Then in base.mode add the line: ctags.file=c:\projects\csi\tags Find Tag (Ctrl-T) will go to the definition of a function, if it exists in the database. This pushes the mark, so you can use Ctrl-J to go back. Find Tag in Other (CtrlShift-T) will open the definition in another form. There is a tags file supplied with the Sciboo source for you to experiment with. Compiling Programs Out of the box, Sciboo supports C/C++ (GNU or MS), C#, Python, Boo and Delphi. To add another language is simple; one specifies the command-line and a regular expression for extracting filename and line number information from the output (See the examples in cxx.mode and python.mode.) If the compilation (F7) is successful and there are no output messages, then the messages pane is not made visible. For compiled languages, running a program (F5) will automatically check whether the target is out-of-date and rebuild the executable. If the program has no output then the output pane is kept hidden. An interpreted language like Python is handled slightly differently. Error messages will appear in the output window, whether they're compile or runtime errors (which is not a big distinction with Python). Double-click on the messages in the output that contain file names and line numbers and Sciboo will open the file at that line. (This also applies to .NET tracebacks.) To compile a program as a DLL, you need a special _compile directive_ in the first line. For example, # @compile{dll} # dll.boo class Fred: static def Hello(): print "hello, dolly" If a Boo or C# program requires extra library references, then you use another compile directive. For example, usedll.cs loads dll.dll: // @compile{refs:dll} class Test { public static void Main(string[] args) { Fred.Hello(); } } Which is a roundabout way of writing the canonical first program in two languages! The refs directive can take a list of libraries, separated by commmas. It is possible to define _projects_. When a file is loaded, Sciboo will look through its list of projects, and attempt to match by filename. For instance, here is the project file I use to work on my CSI project: # project.csi.mode name=CSI mode=C# path=d:\downloads\csi files=csigui.cs console.cs interpreter.cs prepro.cs build=csc /nologo /t:winexe /out:csigui.exe csigui.cs console.cs interpreter.cs prepro.cs go=csigui.exe And here's the project file for Sciboo itself: # project.sciboo.mode extension=boo path=c:\net\sciboo files=sciboo.boo FindAndRun.boo Commands.boo tabform.boo ScintillaEx.boo FUtils.boo ModeFile.boo build=booc -t:winexe -r:ScintillaNET.dll $(files) The project name is optional; if it isn't given, it will be taken from the name of the mode file. You can specify the mode explicitly (as in the first case) or implicitly by extension. The file list may contain wildcards. Here is an example of a project which I created to browse the SciTE source code: # project.scite.mode mode=C++ files=src\*.cxx win32\*.cxx ctags.file=here It's placed in the base directory of SciTE (if path isn't specified, then it's assumed to be the path of the project file). 'here' means the same thing as '$(path)\tags'. It is perfectly possible to be working on more than one project at a time. You can also work on small stand-alone programs at the same time. But a given file can only belong to one project at a time. Mode Files All Sciboo configuration is done with mode files, based on the syntax used by Neil Hodgson's Sinkworld project. They are similar to SciTE's property files (# for comments, variable=value pairs) but are hierarchical. A given mode file may define a number of modes, e.g. cxx.mode. For styling purposes, Scintilla considers C, Java, C# to be submodes of C++ - they all use braces in the same way. A language mode needs a lexer (CPP in this case) unless it's a submode, in which case it inherits all the properties of its parent including the lexer. It needs keywords.1 to be set to a list of keywords, preferably alphabetically sorted, and style to contain a set of style-name:style-definition pairs. You can always access previously defined properties with $(propname), so the recommended practice in Sciboo is to define the actual style values in base.mode, which is automatically the parent mode of all other top-level modes. So for instance, 'comment.style=fore=#008000' is defined in base.mode, and in cxx there will be a property 'style.Comment:$(comment.style)'. In this way, all supported languages will use consistent styles. On start up, Sciboo will read all files with extension mode from the same directory as sciboo.exe - base.mode is guaranteed to be read first. Then any .mode files in the current working directory will be loaded, starting with local.mode. (The current working directory is determined by the 'Start In' folder in a shortcut, or by the path active when launching from a command prompt.) local.mode is an opportunity to redefine properties defined by base.mode. If you have opened a file with a supported extension, then Tools|Edit Mode will open up the associate mode file; Tools|Edit Global Mode will open base.mode. After making any style changes, you will have to run File|Reload Mode Files. Abbreviations A nice feature of SciTE is the ability to expand abbreviations using Ctrl-B. For example, languages like C# and Java involve a lot of repetitive typing. You can put this in your base.mode file: abbrev: pu=public @ pro=protected @ pri=private @ ps=public static @ po=public override @ wl=Console.WriteLine(@) The '@' indicates where the cursor must be positioned after the insertion. (SciTE uses '|' for the same purpose, but '@' is less likely to interfere with valid code.) I can now type 'wl' followed by Ctrl-B and Sciboo will insert the replacement. Abbreviations can be defined just for a particular mode. In the above example, it would be better to put the above definitions in cxx.mode, in the C# submode, and in fact there are already a few defined there. Sciboo takes abbreviations further; it allows a abbreviation to _prompt_ for variables. For example, if you type 'for' in a C#/C++/Java file, and follow with Ctrl-B, you will be prompted for the loop variable and the size. Hit and the for-statement will be generated for you. See the definition at the end of base.mode for more details. You may add an abbreviation while Sciboo is running, but then you must explicitly use File|Reload Mode Files to make them available. A useful alternative to ctrl-B is abbrev.boo in example-plugins. If installed, this plugin will fire abbreviations whenever a back tick (`, just below the escape key) is typed. I find this an easier stretch than ctrl-B, though your mileage may vary. To install this plugin, copy abbrev.boo to the Sciboo directory, and open in Sciboo; Run|Build (F7) and your extension is compiled and installed.