Tutorial 2 Programming Editors Recommendation & Cordova Plugin Installation and Management Li Xu Email: xuli@se.cuhk.edu.hk Department of Systems Engineering and Engineering Management
Programming Editors Recommendation Sublime Text 3
Sublime Text 3 Advantages 1. Multiple Cursors It is great for making multiple edits or inserts in your code at the same time. For example: Highlighting text and using “Ctrl+D” will let you select and change other matching occurrences of that text “Ctrl+click” will place multiple cursors at specific spots
Sublime Text 3 Advantages 2. Shortcuts 3. Fuzzy Search There are lots of shortcuts in sublime 3, which will improve your programming efficiency. For example: Indent: “Ctrl+]” Unindent: “Ctrl+[” Duplicate line: “Ctrl+Shift+D” Delete line: “Ctrl+Shift+K” 3. Fuzzy Search A fuzzy search means you only need to enter a few key characters and Sublime Text will try and match these with a list of what it thinks are the most relevant commands.
Sublime Text 3 Advantages 4. Code Preview One pretty useful feature of Sublime is the condensed preview of your code layout, especially for large pages. This allows you to quickly view and select areas of your code based on its overall shape and structure.
Sublime Text 3 Advantages 5. Book Marking 6. Plugin Community Book Marking is another one of those great features that you don’t know you are missing out on until you start using it. While there are plenty of good ways in Sublime to skip to specific areas of code (such as got to line number “Ctrl+G” or go to next bracket “Ctrl+M”), book marking allows you to set specific way points for faster access. Using the command “Ctrl+F2” sets a bookmark and “F2” will skip through each bookmark specified. 6. Plugin Community Sublime Text has a huge and active plugin community and with thousands of plugins available, any features you may miss from other text editors are likely to exist in the Sublime plugin repository.
Sublime Text 3 Advantages 7. Configurability You can install custom themes to change the GUI and code colours for example. Plugins and key bindings allow you to improve your coding process and the splitting code editor window allows you to work on different files side by side “Alt + Shift + Number”.
Sublime Text 3 Download & Install Download Sublime Text 3 from the following link: https://www.sublimetext.com/3 There are several versions suitable for different operation systems
Sublime Text 3 Download & Install Steps for installation (e.g. windows 64, others are similar with this):
Other Programming Editors: Notepad++ Vim Visual Studio Code Gedit And also, there is a web containing some introduction of useful programming editors: https://www.slant.co/topics/12/~best-programming-text-editors
Cordova Plugin Installation and Management What are plugins and what are they used for? A plugin exposes a Javascript API for native SDK functionality. Plugins are typically hosted on npm and you can search for them on the plugin search page. Some key APIs are provided by the Apache Cordova open source project and these are referred to as Core Plugin APIs. When you build and view a new project, the default application that appears doesn't do very much. You can modify the app in many ways to take advantage of standard web technologies, but for the app to communicate closely with various device-level features, you need to add plugins that provide access to core Cordova APIs.
Cordova Plugin Installation and Management How to install the plugins you want? You can use the command “cordova plugin search + package name” to search plugins you are interested in, and use the command “cordova plugin add + package name” to install them (They can also be added using a directory or a git repo).
Cordova Plugin Installation and Management Using Plugman to Manage Plugins 1.Installing Plugman: $ npm install –g plugman 2.Create a Cordova Project 3.Adding a Plugin: $ plugman install --platform <ios|android|blackberry10|wp8> --project <directory> --plugin <name|url|path> name: The directory name where the plugin contents exist. url: A URL starting with https:// or git://, pointing to a valid git repository that is clonable and contains a plugin.xml file. path: A path to a directory containing a valid plugin which includes a plugin.xml file.
Cordova Plugin Installation and Management Using Plugman to Manage Plugins 4.Remove a Plugin $ plugman uninstall --platform <ios|android|blackberry10|wp8> --project <directory> --plugin <id> 5.Help Commands $ plugman -help 6.Registry Actions Searching for a Plugin: plugman search <plugin keywords> Changing the Plugin Registry: plugman config set registry <url-to-registry> plugman config get registry Get Plugin Information: plugman info <id>
Question Time