Salesforce Lightning support in Sublime Text 3 for Mac OSX

ToolsIf you’re developing Salesforce Lightning components you’ll probably reach a stage where you get fed up of using the Dev Console. Right now the Eclipse based IDE doesn’t support lightning and Joe Ferraro is still working on the latest updates to MavensMate.

One option is to use Dave Carrol‘s Lightning Tools plugin for Sublime Text. I had a bit of a headache getting this to work on my Mac and with a bit of googling have finally succeeded so I just wanted to wrap it all up here.

Firstly I’m using Sublime Text 3 with MavensMate v6 installed on a Mac running El Capitan. So I’m assuming you’re at the same starting point.

  1. Firstly you need to install the plugin:
    • Open Sublime Text.
    • Open the menu: Suplime Text -> Preferences -> Package Control
    • Select: Package Control: Install Package
    • Enter lightning when prompted.
    • Ignore the error: Sublime Lightning Plugin requires the CLI to function
    • Quit Sublime.
  2. Next you’ll need the Command Line Interface:
  3. Create a symbolic link to Sublime in /usr/local/bin:
    • Open Terminal.
    • Enter the command:
      sudo ln -s “/Applications/Sublime” /usr/local/bin/subl
  4. Create a symbolic link to the CLI in /usr/local/bin:
    • Open Terminal.
    • Enter the command:
      sudo ln -s /mypath/force /usr/local/bin/force
      (replace /mypath with the path you saved the CLI in)
  5. Run sublime from the Terminal:
    • Open Terminal
    • Enter the command:
    • You should no longer get the error: Sublime Lightning Plugin requires the CLI to function
  6. Use the Lightning right-click context menu on your Salesforce project to Login and work with your lightning components.
    • Lightning Context Menu

The extra hoops are because Sublime requires the tools to be available in the path. If you launch Sublime outside of Terminal the path is ignored and the error message is generated.

There is a sublime text plugin that allows the path to be specified called SublimeFixMacPath but I couldn’t get it to work in El Capitan.

While it’s not exactly elegant launching from the command line it’s a reasonable workaround for now.


Author, brainstormer, coder, dad, explorer, four chord trickster, gig goer, home worker, inquisitor, joker, knowledge seeker, likes: marmite, note scribbler, opinionator, poet, quite likes converse, roller skater, six music listener, tea drinker, urban dweller, vinyl spinner, word wrangler, x-factor hater, Yorkshireman (honorary), zombie slayer (lie).

Tagged with: , , , , ,
Posted in code,, salesforce
One comment on “Salesforce Lightning support in Sublime Text 3 for Mac OSX
  1. […] Source: Salesforce Lightning support in Sublime Text 3 for Mac OSX […]

Comments are closed.

About Me
Product Services Developer at:
All views expressed here are my own. More about me and contact details here.
Please sponsor me …
My wife and I are running the Great North Run to support The Nick Alexander Memorial Trust

If you've found my blog useful, please consider sponsoring us. Sponsor me on BT MyDonate

Enter your email address to follow this blog and receive notifications of new posts by email.

Copyright (there isn’t any, feel free to reuse!)

To the extent possible under law, Tony Scott has waived all copyright and related or neighboring rights to Examples and Code Samples. This work is published from: United Kingdom.

%d bloggers like this: