-
Notifications
You must be signed in to change notification settings - Fork 14
Using Sublime Text with Levure
- Overview
- Get Sublime Text
- Install LiveCode language package
- Configure Sublime Text user settings
- Install LiveCode linter
- Notifying LiveCode of script-only stack updates in Sublime Text
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.
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.
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:
-
Within Sublime Text, bring up the Command Palette and type
install. Among the commands you should seePackage 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. -
When the packages list appears, type
livecode. Among the entries you should see one starting withLiveCode. Click on theLiveCodeentry or select it and pressEnterwith your keyboard to install the language package.
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.
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:
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
}
}
}
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.
Levure is an application development framework written for LiveCode.