Edit a file in Orion Editor

In this entry, I’ll explorer how to edit code using Orion editor. First, we need sample code to start. I choose Node express (http://expressjs.com/) to show how to edit code. If you did not install express, The express module can be installed using “npm install -g express”. I created hellonode example, and then run Orion Editor.

C:\Workspaces\newproject\node.app>express -e hellonode
 create : hellonode
C:\Orion>node node_modules\orion\server.js -workspace c:\Workspaces\newproject
Using workspace: c:\Workspaces\newproject
Listening on port 8081...

When I click app.js, it open the editor in the right hand pane. You may notice that some keywords are color highlighted already. And many many errors by the icon (20140117-errorMediumIcon).
I needs to put the following line in the code.

1 | /*jslint node:true*/

This is because Orion includes JSLint feature as a plugin to this editor by default. This feature enables to check the contents, especially syntax of JavaScript. However, it causes numerous error in the editor if it is node application. The above line tells JSLint that this is Node application.

20140117-edit code at first

But still I see error, when I click the error icon ( 20140117-errorMediumIcon). It shows the message “Expected ‘===’ and instead saw ‘==’. “.
This is also an feature of JSLint that comparison should compare the type correctly. If I change to ===, then error went away.

Now, let’s look at another feature, If I enter control+space, it opens small dialog just like below.

20140117-context assistance javascript

The dialog is context assistance to enter keywords correctly and more efficiently. This is language dependent. For example, if I’m writing a style sheet, then it opens style sheet specific keywords.

20140117-context assitance style sheet

However, this is limited to several language. Unfortunately, it does not work for “.ejs” (Embedded JavaScript templates) files.

This editor allows to change keyboard bindings. We can change to “Emacs” or even “vi” !


Finally, there is keyboard short cuts. For example, control+’s’ works as expect as ‘Save’ function. You can use control+’c’ and control+’v’ for cut and paste. It is natural as normal editor (remember this is within the browser !). List of Keyboard short cut key is available in “Options” menu in case of Orion editor Node version.

There are much more features than explored in this topic on Orion editor.  For more information about Orion editor, refer to Orion user guide wiki page.


This entry was posted in JazzHub. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s