Sublime Text 2
Installation and setup is a little clunky in Sublime Text 2. Hopefully this can be improved as the editor matures. We really need an api call to allow us access to the current project file (hint, hint).
This installation includes a number of "snippets", so you can quickly construct common blocks of code, but these snippets have simply been quickly copied from the Sublime's Java support, and include no Salesforce-specific features. If anybody is keen on extending these, we'd be happy to update the package!
We have begun the process of making this code available on Github as part of https://github.com/SublimeText
- Install Java and ensure it's on your path.
- Install Exuberant ctags and ensure it's on your path. (sudo apt-get install ctags)
- Install Sublime Text 2
- Start Sublime Text 2
- Select menu item "Preferences : Settings - User" and add a setting that defines the location of the Stuntbyte all-purpose "jdbc" jar file you downloaded from the download page. Save the change. eg:
- Download the Stuntbyte "editors.zip" and unzip it.
- Put the Packages directory (/sublime2/Packages in editors.zip) under
- ~/.config/sublime-text-2 (Linux) or
- "%APPDATA%/Sublime Text 2" (Windows) or
- "~/Library/Application Support/Sublime Text 2" (Mac OS)
- Install ctags support into Sublime Text, per instructions at https://github.com/SublimeText/CTags. eg:
- Copy sample.sublime-project and ide.properties (from /sublime in editors.zip) into another folder, eg "/tmp/projects"
- Edit sample.sublime-project and point "ide.properties" at the file, using an absolute pathname. eg: /tmp/projects/ide.properties
- Edit ide.properties and define the sf host, username and password (ie: security token + password) for your development environment.
- Open the sample project file in Sublime, using the Projects menu.
- Download Salesforce code, using the Projects Menu: Salesforce Download All.
- Refresh the folder view, using the Projects Menu: Refresh Folders.
- Generate tags: from Projects Menu: Salesforce Retag. You must be viewing an Apex class or Trigger for this to work correctly.
- Navigate classes with CTRL-P (and start typing)
- Navigate symbols within a class with CTRL-R
- Drill into methods or classes with CTRL-ALT-]
- Pop back with CTRL-ALT-[
- Compile a class with F7. If the class name ends in "Test" or "Tests" then we also execute the tests. If errors occur, navigate to offending lines by clicking on the error message.
- View the automatically generated debug.log file to see details of the test run