Corona Editor + Sublime Text

Share on Facebook0Share on Google+1Tweet about this on TwitterShare on LinkedIn4

One of our guiding principles in building Corona SDK was that the developer experience mattered. This means enabling you to do things as quickly and easily as possible. Simplicity is key – we want to take something complex and remove all the unnecessary elements, so you can focus on the work that matters.

Recently, we decided we wanted to extend that point of view to the actual coding experience. Now the community has already produced some fantastic mobile tools and IDEs, so instead, we looked at the more basic problem of editing code.

Corona Editor

Corona-Editor-SublimeToday, I’m happy to announce Corona Editor (Beta), our answer to the old problem of making code editing painless. It takes what we think is the world’s best text editor, Sublime Text, and provides first-class integration with Corona SDK.

Take a look at this video tour to see how Corona Editor is a natural fit with the Corona philosophy of keeping the tool lightweight, so you’re able to make good use of it immediately:

As you can see, initial features include code completion for all APIs and constants, the ability to bring up API docs directly from your code (public release or daily build docs), and hot keys to launch your app in the Corona Simulator from Sublime.

There are still bugs to be worked out as it’s still in Beta, but you can play with it today! Head over to Corona Editor for instructions on how to install Sublime Text and the Corona Editor package.

Open Source

github-logoWe are making Corona Editor completely open source, so send us your pull requests. Your contributions will help the entire Corona community!

In terms of future improvements, we’re looking at console integration directly in the Sublime editor and debugging support for breakpoints. Let us know if you’d like to help!

One of the things we hope this plugin will do is improve code editing in other text editors and IDEs. The Corona Editor project comes with a raw list of Corona APIs. They’re generated straight from our docs to enable code completions in Corona Editor. We will automatically be updating this file to reflect changes in daily builds, so this should be especially handy for enabling completions in other text editors and IDEs.

Special thanks to Christopher Spence for his invaluable insights and feedback during development.

Share on Facebook0Share on Google+1Tweet about this on TwitterShare on LinkedIn4

This entry has 34 replies

  1. Jorge says:

    Awesome! I’ve been using Sublime + Corona as my main editing tool for a while, glad to see it’s becoming even more integrated.

  2. Damir says:

    Is there a way to see all functions inside a lua file (and goto)?

  3. ojnab says:

    @damir, on mac it’s cmd+r.

    • Damir says:

      The list is sorted as the function are ordered inside the lua file.

      Is there a way to get the list sorted alphabetically ?

  4. ojnab says:

    console integration is easy on mac. Just make a new build system looking like this:
    {“cmd”: [“/Applications/DailyBuilds/CoronaSDK.1202/Corona Terminal”, “main.lua”]}
    (with your own corona path off course). Now corona terminal will run in the build results console.

    You can put a shortcut on “show build results” in the User Keybindings like this
    { “keys”: [“super+$”], “command”: “show_panel”, “args”: {“panel”: “output.exec”} }

  5. MOcean says:

    64bit windows users will have to amend the path to the Corona Simulator executable. If you’re already a daily ST2/3 user, this is second nature. If not:

    Preferences menu->Browse Packages
    Open the Corona Editor folder and drag ‘Corona SDK.sublime-build’ into sublime for editing. Change line #6 to add (x86) as such:
    “cmd”: [“C:\\Program Files (x86)\\Corona Labs\\Corona SDK\\Corona Simulator.exe”, “$file_path\\main.lua”],

    and you’re done.

  6. Doug Davies says:

    When I do something like display.newCircle( ) I don’t see the parameters like the video shows. Ideas?

    • Tom says:

      Which version of Sublime are you using? I have the same issue with Sublime Text 3, which seems to down to the plugin looking in the wrong directory for completions file.

      I’ve tried fixing it myself, but for some reason playing with the sublime-package file seems to create new, seemingly unrelated problems. Anyone have any idea what might be causing that?

  7. Peter says:

    I’ve been a user of Coda for a while, but when working with Corona, the options have been pretty limited. I’m excited to try out an IDE that is specifically geared toward Corona integration. That said, should I download Sublime 2 or 3?

  8. As a Sublime Text user, this is another thing to love Corona SDK even more. Thanks Walter!

  9. Antheor says:

    MOcean I have indeed some problems with ctrl B on my windows 64.

    I can’t find corona editor folder, I only have a “Corona Editor.sublime-package” …

  10. Antheor says:

    … I guess your tip works only if I do a manual installation (download).

    • Antheor says:

      I tried to create my own build with :

      “selector”: “source.lua”,

      “cmd”: [“C:\\Program Files(x86)\\Corona Labs\\Corona SDK\\Corona Simulator.exe”, “$file_path\\main.lua”],
      “file_regex”: “(^[C-Z]:[^:]*):([0-9]+):([0-9]*)(.*)”

      “cmd”: [“open”, “-a”, “/Applications/CoronaSDK/Corona”, “$file_path/main.lua”],
      “file_regex”: “(^/[^:]*):([0-9]+):([0-9]*)(.*)”

      Still getting the same error…

      • MOcean says:

        No… Mine was installed using Package Control. Perhaps this is something simple like windows hiding ‘system’ files? Maybe hidden file extensions is letting you create this file? Unclear. At any rate, the build file you have above won’t work because you need a space between Files and (X86). You can try changing that and see if you do better. Wacky situation.

        Try adding the space..?

  11. ojnab says:

    I would like to say that I think it is a wise decision by Corona Labs
    to do a package for Sublime instead of wasting energy on creating an IDE of
    their own. Sublime text is superb… feels so good in your hands and eyes.

  12. brocoli says:

    Why is the syntax based off the native Sublime Lua syntax rather than the LuaSublime package one?

  13. Antheor says:

    No way for me to see the folder….

    Anyway your correction on my custom build is working !

    Thank you !

  14. I don’t recommend changing the build file shipped with the plugin. It will just get overridden next update. I suggest making a copy in your user folder when using browse packages. Then selecting this build system in the menu. It will persist between updates.

    Unfortunately the build system file is not 100% compatible with all windows machines. Future updates hopefully with have user config file so you can set your own path and the build file will be dynamic.

    I would recommend st3 for new users. It’s nearing release and most plugin developers are focusing their effort on st3 and not st2.

  15. Alex Poon says:

    Neat, but I’d love to get something similar as an Eclipse plugin!

  16. Alan says:

    One thing I would like to see fixed (and I presume you are already working on) is that as soon as you press “.” the autocomplete disappears.
    This means that while I’m typing “display” I get ALL of the display functions and properties. If I want to narrow that down to just the ones that begin with “” however, the autocomplete disappears and I have to type it in myself which makes it far less useful. If I want to use newRoundedRect, I have to press down over 30 times (you can’t press the up arrow or you move the cursor up to the next line), or switch to the mouse (and no one wants that).

    Other than that, good stuff!

    • This is being worked on, but you can select your choice before finishing typing.
      I’m trying to get Fuzzy enabled again as that is how it was initially designed, this would make it even easier.

  17. Looking forward to this. Two of my favorite development tools!

  18. Craig says:

    Awesome! you made a wise choice here. I’m not changing to any other text editor after falling in love with Sublime.

  19. Hey I’m with Doug! Why aren’t all the parameters showing up when I hit auto complete? Windows 64bit Sublime 2.

    πŸ™ Without those I’m lost….


  20. Craig says:

    Also how do I get to read console output in Sublime? Hitting build from Sublime seems to work but it should also launch a console window too right?

  21. Ah ha. Figured it out. If you type ‘display.newIm ‘ it’ll give you the auto complete choices but with no parameters. The secret is not to type the ‘.’ and THEN choose the function you want and THEN hit TAB, and it’ll auto complete with the parameters.

    Hmmmm, might have to give Sublime another go. It’s been years. πŸ™‚

  22. Piotr says:

    After comment “–” you can’t tab, beacuse it will automcompete words.
    Is there way around this?

  23. Maybe a stupid question but how can I start Corona Simulator to test my application from within Sublime?

  24. Vic says:

    Great work! Keep up growing, you deserve it because you have an awesome tool πŸ™‚

  25. Dougi says:

    Anyone else having problems getting the plugin to show up in Sublime text / view / syntax?

    I’ve installed via the instructions here:

    Tried both manual and console installs on both Sublime 2 and 3 and nothing showing.

    I’m on OSX 10.8.5

    The plugin shows up in the “Installed Packages” folder.

    Any idea what I’m doing wrong please? Would really like to get this working ‘cos it looks brilliant.

  26. Antheor says:

    Claude, I’m sure you found it now : cmd+B

    BTW, is there any way for cmd+B NOT to open each time a new simulator ?


    • Perry says:

      You need to be running the latest Corona Simulator.

  27. Tyler says:

    Question: In sublime if I double click on a object, like “doorObject.alpha”, in textWrangler, it would just select “doorObject”, but now in sublime it selects “doorObject.alpha”, which isn’t what I want. I tend to copy big sections of code to reuse, and need to quickly relabel all the objects in that section of code, so I need to be able to quickly select just the object name, and not the whole thing including the period and setting. I’ve been searching for how to change this default, but can’t find it.

    • Perry says:

      The relevant preference is documented in the

      * **corona_sdk_complete_periods** (default: True)

      Corona Editor turns off the special meaning of periods as “word separators” in Sublime Text to make Corona completions work better. If you like to use cursor movement keys like “Alt+Arrow” to move to the periods in function calls you might want to turn this off. The most obvious effect of turning it off is that when you type a period all the completions disappear until you type another character.

      Just set that in your Sublime Text user preferences file (you can open it using [B]Preferences > Settings – User[/B] like so:

      “corona_sdk_complete_periods”: false

      More info on Sublime Text preferences here: