VIM is one of the world's great text editors, and now you can use it when developing Salesforce code. It does have a steep learning curve, but it's worth the effort.
Here's how to set it up:
- 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 VIM
- Download the Stuntbyte all-purpose "jdbc" jar file from the download page.
- Download the Stuntbyte "editors.zip" and unzip it.
- Edit "stuntbyte.vim" (from /vim in editors.zip) and ensure that the "runIde" line refers to the location of the stuntbyte jar file on your system.
- Edit ide.properties (from /vim in editors.zip) and define the sf host, username and password (ie: security token + password) for your development environment.
- Start the "ide" using: vim -S stuntbyte.vim
- Download all source code using ",da" in edit mode
- Tag the source code using ",tag" in edit mode
- Navigate source using standard tag commands, eg: :tag <classname> and CTRL-] (You really should read :help tags)
- 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.
- Use F3 to view the automatically generated debug.log file, and see details of the test run
The full list of supported commands is as follows:
|F2||'Drill down' to the current token, splitting the window on the way|
|F4||Make the debug log easier to read|
|F7||Save the current file to Salesforce. Runs tests if it's a test class|
|F9||Disable a test method (must be on the 'testMethod' declaration)|
|F10||Enable a test method (must be on the 'testMethod' declaration)|
|F11||Disable all test methods|
|F12||Enable all test methods|
|,d||Download the latest version of the currently edited file|
|,da||Download the latest version of all files|
|,uf||Force a save (upload) of the current file, even though it is out of sync with the version on the server|
|,tag||Retag the source|