SublimeText for Clarion

My personal favourite for editing all sorts of code is SublimeText. When I first came across it there was no support for Clarion so I created a plugin/package:

http://www.clarionedge.com/clarion/general/clarion-syntax-for-the-sublime-text-editor.html
https://sublime.wbond.net/packages/Clarion

If you have not tried SublimeText then I suggest you give it a go! I used to use TextPad, tried Notepad++, tried a few others, none of them had everything I wanted. TextPad is probably still the fastest thing I have seen for loading large files but at the time it was feeling outdated in other areas.

One of my favourite things with SublimeText is the way I can navigate class files.
Say for example, I want to look at the WindowManager.Init method in ABFILES.CLW.

I have a SublimeText project in C:\Clarion6 that looks like this:

{
    "folders":
    [
        {
            "path": "Libsrc",
            "name": "Libsrc - Root"
        },
        {
            "path": "3rdParty/LIBSRC/",
            "name": "Libsrc - 3rdParty"
        },
        {
            "path": "Template",
            "name": "Template - Root"
        },
        {
            "path": "3rdParty/Template",
            "name": "Template - 3rdParty"
        }
    ]
}

With this project open SublimeText give me super easy access to all the files in those directories.

When I open SublimeText it remembers the files I had open previously, even unsaved ones, and if I had a project open then it will automatically re-open that project. So I start out with this:

Then, to get to the Init method of the WindowManager I do this:

  1. Hit Ctrl+P (Goto Anything command)
  2. Type abw@in
  3. Hit the Enter key!

Notice how it live loads the file in the background? Thanks to the Clarion package for SublimeText it knows about Clarion methods so after the @ you can see the full list of methods in the selected file.

This goes for ANY class or template file in the paths defined in my project. There is also search and a whole bunch of other things.

Oh and just wait till you get the hang of multiple edit cursors… that is just plain brilliant :smile:

2 Likes

By the way, the package for Clarion has just been updated to v1.0.7 with a few new fixes merged from @MarkGoldberg !

https://sublime.wbond.net/packages/Clarion

How to install Clarion support inside of Sublime Text:

If you haven’t already installed package management then follow the directions at https://sublime.wbond.net/installation#st2 note: there are two tabs, one for ST3 and one for ST2 (make sure you have the correct one, I use use ST2)

Once you have Package Management Installed (and you really REALLY want that)

  1. Tools.CommandPalette (CTRL+SHIFT+P)
  2. Type: [Install] < enter > [Clarion] < enter >
    no need to restart, it’s live right away

Optional configuration to be able to select clarion syntax with CTRL+ALT+C vs. having to go to View.Syntax.Clarion. I use this on untitled files, and the results of find in files.

Add the following entry to Preferences.KeyBindingsUser,

  { "keys": ["ctrl+alt+c"], "command": "set_file_type", "args" : {"syntax": "Packages/Clarion/Support/Clarion.tmLanguage"} },