Skip to content

Using Sublime Text with Levure

Brian Spencer edited this page Mar 14, 2017 · 13 revisions

Contents

Overview

With the introduction of text based script-only stacks in LiveCode, and the ability to use them for object behaviors as well as libraries, it is now practical to write, edit, and manage all LiveCode scripts with a text editor such as Sublime Text. This article describes how to set up Sublime Text as a LiveCode script editor.

Get Sublime Text

If you don't already have it, you can get Sublime Text here.

If you are setting up Sublime Text for the first time, you should also install Package Control.

Install LiveCode language package

The LiveCode package for Sublime Text adds syntax highlighting for LiveCode script files. It is intended for editing script-only stacks.

The package includes a number of snippets that provide auto-completion when creating new handlers, if-then statements, try/catch blocks, etc. Auto-complete is also provided for all keywords, properties, functions, and commands.

To install the LiveCode package in Sublime Text, use Package Control. This ensures the plugin will be updated when new versions are available.

To install via Package Control, do the following:

  1. Within Sublime Text, bring up the Command Palette and type install. Among the commands you should see Package Control: Install Package. If that command is not highlighted, use the keyboard or mouse to select it. There will be a pause of a few seconds while Package Control fetches the list of available packages.

  2. When the packages list appears, type livecode. Among the entries you should see one starting with LiveCode. Click on the LiveCode entry or select it and press Enter with your keyboard to install the language package.

Configure Sublime Text user settings

Screencast

This screencast by Trevor DeVore shows you some settings you can change in your Sublime Text user preferences to improve your experience while editing and managing your LiveCode script files in a version control system such as Git.

Install LiveCode Linter

The linter plugin for SublimeLinter provides an interface for checking syntax for LiveCode scripts in Sublime Text. The linter will be used with files that are using the “LiveCode” syntax in Sublime Text.

You can get the LiveCode linter and installation instruction here:

Notifying LiveCode of script only stack updates

To send requests to a specified server and port whenever LiveCode files are saved, create a Sublime Text project for your folder tree. Once you have done that, edit the .sublime-project file. Here is an example. You will need to modify "MyProject" and possibly the port number that you are using.

{
    "folders":
    [
        {
            "folder_exclude_patterns":
            [
                "_builds"
            ],
            "path": ".",
            "name": "MyProject",
        }
    ],
    "livecode":
    {
        "notify_on_save": true,
        "notify_server":
        {
            "host": "localhost",
            "port": 61373,
            "debug": false
        }
    }
}

Screencast

This screencast by Trevor DeVore shows you how to configure a Sublime Text project to send a notification to a Levure application running in the LiveCode IDE every time you save a .livecodescript file.

Clone this wiki locally