I’ve written a plug-in package for the excellent Sublime Text 2 for creating and editing RoboMatter RobotC code for Lego Mindstorms NXT and other RobotC platforms. Allows you to write RobotC code on Mac OS X, Linux and Windows in a very clean and fast text editor. Does not compile or debug, you still need the IDE for that. It’s only v0-2 so far and a bit rough around the edges, but I’m finding it quick and elegant and it’s great to be able to write code on Mac or Linux as I’m not a Windows fan.
The plug-in provides the following functionality:
- C syntax color formatting via the Command Palette.
- Basic C code snippets via the completions list.
- RobotC functions and variables completions via the completions list.
- Search for relevant RobotC functions and variables by category via the completions list.
All RobotC platforms are covered including Lego Mindstorms NXT, VEX, Cortex, PIC, Tetrix and Arduino, although there may be emphasis towards Mindstorms NXT as that is my primary platform.
- Copy RobotC_v*-*.sublime-package to ~/Library/Application Support/Sublime Text 2/Installed Packages on Mac OS X. Here are Linux and Windows installation instructions.
- Start Sublime Text and the package should auto-install.
There are a few ways to check this, the easiest is to open the Command Palette and type ‘syntax’ and look for ‘RobotC’ in the list.
Once the code is a bit better I will get it registered to install with the excellent Package Control.
Once RobotC syntax selected. The main RobotC functionality is in the functions and variables completion list.
- To auto-complete a function or variable, start typing a function name, variable name or code snippet name using lower case and access the completions list with CTRL+spacebar. Each value within a function can be jumped between with the TAB key.
- To search for all the functions and variables within a RobotC category, start typing a category name in UPPER case e.g. ‘BLUETOOTH’ will list all the commands related to bluetooth. (See the file ‘BuiltInVariables.txt’ included with the RobotC IDE installation, or look at the API titles.)
- You can also search in similar way via platform name shortcuts (see the file ‘BuiltInVariables.txt’ included with the RobotC IDE installation) e.g. ‘NT’ for Mindstorms NXT.
- To access code snippets start typing their name in the completions list e.g. ‘main’ or ‘for’. Have a look in the RobotC package directory for current snippets.
- 0.1 – getting something working.
- 0.2 – full functions and variables completion with TAB between values. Search via category and platform. Descriptions improved.
- Create a RobotC specific version of the .tmLanguage file?
- More code snippets e.g. while loops.
- Code snippets often come up twice as the scope of RobotC is the same as C ie .c files. Fix this so snippets only come up once. If this bothers you at the moment, delete the .sublime-snippet files in the RobotC package directory.
- Figure out a quick way to get the code into the RobotC IDE.
- Add support for RobotC Driver Suite from Xander Soldat.
- Review changes from RobotC 3.55, and build in.
- Test it:-))
Report to ‘moo >-at-< moosooboo >-dot-< com’
- RobotC.sublime-completions is built around ‘BuiltInVariables.txt’ provided with the RobotC IDE installation.
- RobotC.tmLanguage is currently a lightly edited copy of the file ‘C.tmLanguage’ included with Sublime Text.
Still not figured this out, but use as you like with a link or credit to myself, and also credit to the files listed in Attributions.
The nice guys at Robomatter gave me a mention http://www.robotc.net/blog/2013/03/04/sublimetexteditor/ Thanks guys!