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 ().
I needs to put the following line in the code.
1 | /*jslint node:true*/
But still I see error, when I click the error icon ( ). 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.
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.
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.