Atom text editor
Atom is an amazing open source text editor, that is also fully customizable for Particle development. Particle is already offering Particle Dev app (witch is based on Atom). So if you want to quickly get started with writing your Photon/Core code, go ahead and use the Particle Dev app, it is easy to use.
So… wait a minute, why write a tutorial on Atom then?
Well… if you’re like me, and you love customizing things to your liking, then give this tutorial a shot. You will learn how to setup Atom so you can compile and flash your Photon/Core apps, get browser access to https://docs.particle.io, as well as set-up terminal window for CLI commands all this within Atom itself.
- Download the latest Atom text editor
- Install the necessary Spark(Particle) Atom pkgs
- Install the browser-plus pkg and terminal-plus pkg
Step 1: Download the latest Atom text editor version
The latest Atom text editor version can be found HERE Go ahead and install the latest version of Atom for Mac.
Step 2: Install the necessary Spark(Particle) packages for Atom
There are a few packages that you need to install within Atom, in order to use it just like the custom Atom based Particle Dev app.
Upon opening Atom you can close the open Atom window (do not quit Atom itself). Then go ahead and click on the “Atom” menu button on the toolbar, then “Preferences”. This will open a new window with a “Settings” tab. This is where you will choose what packages to install to setup Atom to your liking.
Click on the “Install” button (middle column) within this new settings window. In the search field, go ahead and search for “Spark”. Install the following packages:
Additionally you must also install the tool-bar package, this will give you the awesome toolbar (used for things like: compile, flash, select Core/Photon etc…) that is found in the Particle Dev app.
Step 3: Install the browser-plus pkg and terminal-plus pkg
Finally install the browser-plus pkg and terminal-plus pkg for some awsome inside Atom features.
The “terminal-plus” window can be open inside Atom by clicking on the small “+” button that is found on the new toolbar installed at the bottom of your Atom workspace.
For more info look at this picture:
Now… all what is left to do is to configure the “browser-plus” with a keymap of your choice, so you can open it in a window inside Atom. The default keybinding that is set in the “browser-plus pkg”, is “ctr-alt-o”. This keymap can be changed to something else if you want. In my case this coincided with the keybinding for opening a “Remote-FTP” window. “Remote-FTP” is another Atom pkg that can be installed. Thus i had to change the keymap to something else.
To change the keymap, follow the steps below…
Go to “Atom” menu in the menu bar, then click on “Preferences”. There we have to click on “Keybindings” so we can create are own keymap to open the browser-plus window. In the “Keybindings” window, go ahead and click on the link to “your keymap file”.
Here… you can create a specific keybinding to use with “browser-plus”.
'atom-workspace': 'your_shortcut': 'browser-plus:open'
Feel free to change the “your_shorcut” text with the keymap that you would like to use for the “browser-plus” window.
Now you’re all set to go to war and create amazing Particle based projects !!
Here’s how the Atom Workspace could look like with the “browser-plus” and “terminal-plus” windows opened:
Additional Atom Packages to Install
There are some additional packages that can be installed to make the toolbar more useful…
“tool-bar-main” (for adding basic buttons like save, open, find etc…)
“flex-tool-bar” (for adding custom buttons, see description when installing)
If for whatever reason you get some errors about “incompatible native modules”, click on the red bug icon in the status bar and then choose “rebuild modules” button. This should resolve the issue.
Don’t forget to keep Atom and the packages installed up-to-date. This way you can benefit from the latest bug fixes and new features.