- Go to
Preferences
- Type
keymap
- Use drop down to select
Mac OS X 10.5+
#Node.js Manually install node.js and configure WebStorm to use it.
##Download Node.js Node.js download page
##Tell WebStorm Where to Find Node.js
CMD + SHIFT + A
and typenode
.- Select
Node.js and NPM
- Set the
node interpreter
to the node path. (e.g./usr/local/bin/node
)
- Go to
Settings
JavaScript
Libraries
- Check both
Node.js Globals
andNode.js Core Modules libraries
When you open a project with node_modules directory in it, WebStorm will suggest creating a Node.js Dependencies JavaScript library. This action will add these modules to the list of JavaScript libraries used WebStorm for code completion, syntax highlighting, navigation and documentation lookup:
#JSHint JSHint support is built into WebStorm.
You can enable JSHint by:
CMD + SHIFT + A
and typejshint
- Check
enable
Set the appropriate and desired settings for JSHint in the dialog.
Scroll to the bottom and click the Set
link in the Predefined
globals setting. Then enter any globals for node, comma delimited, such as require, process, __dirname, console
#Installing NPM Packages Globally
When installing NPM packages globally you may need superuser permissions. Prefix your commands with sudo
and you will be prompted for your admin password.
sudo npm install grunt-cli -g
#Bower
##Install Bower Use NPM from terminal to install bower globally.
OPTION F12
opens the WebStorm terminal- type
npm install bower -g
to install bower globally
Alternatively, install bower globally from the Mac's terminal
The bower.json
file is a manifest describing what bower packages your project will use.
- Use terminal to create a
bower.json
by typingbower init
CMD SHIFT A
and typebower
- Enter the bower executable's location (e.g.
/usr/local/bin/bower
) - Enter the path of the
bower.json
CMD SHIFT A
and typebower
- Click the
+
sign to add a new bower package - Search for the package
- Select the package
- Set any options you desire such as
--save-dev
- Click
install package
Alternatively, install using bower locally from the Mac's terminal (e.g. bower install toastr
)
##Install NPM Global Packages Install any global packages you require. Some examples include:
- bower
- grunt-cli
- gulp
- grunt
- npm
CMD + SHIFT + A
and typenpm
- Select
Node.js and NPM
- Click the
+
sign to add a new bower package - Search for the package
- Select the package
- Set any options you desire such as
--save-dev
- Click
install package
Alternatively, install globally from the Mac's terminal (e.g. npm install grunt-cli -g
)
#Presenter Mode
When presenting in WebStorm using Presentation Mode is very helpful. You can select View
| Enter Presentation Mode
or set a keyboard shortcut.
Creating a keyboard shortcut for Presentation Mode makes it eaier to enter and leave this mode.
CMD SHIFT A
- Type
keyboard shortcuts
- Replace the search on the right with
presentation
- Select
Toggle Presentation Mode
and right click it - Select
Add keybaord shortcut
- Enter the keystroke(s) (e.g.
CMD SHIFT P
) - Click
OK
AngularJS tips for WebStorm.
##AngularJS File Templates
- Download the AngularJS file templates
CMD SHIFT A
and typeimport
- Select
import settings
- Browse to the file and select it
- Click
OK
and allow the restart of WebStorm, if prompted
(function () {
'use strict';
var controllerId = 'people';
angular.module('demoApp')
.controller(controllerId, ['$scope', people]);
function people($scope) {
var vm = this;
vm.activate = activate;
vm.title = 'people';
activate();
function activate() {
}
}
})();
(function () {
'use strict';
var controllerId = 'widgets';
angular.module('demoApp')
.controller(controllerId, ['$scope', widgets]);
function widgets($scope) {
$scope.activate = activate;
$scope.title = 'widgets';
activate()
function activate() {
}
}
})();
(function () {
'use strict';
angular.module('demoApp')
.directive('peopleSearch', ['$window', peopleSearch]);
function peopleSearch($window) {
// Usage:
//
// Creates:
//
var directive = {
link: link,
restrict: 'A'
};
return directive;
function link(scope, element, attrs) {
}
}
})();
(function () {
'use strict';
var serviceId = 'dataservice';
angular.module('demoApp')
.factory(serviceId, ['$http', dataservice]);
function dataservice($http) {
// TODO: Define the functions and properties to reveal.
var service = {
getData: getData
};
return service;
function getData() {
}
}
})();
(function () {
'use strict';
var demoApp = angular.module('demoApp', [
// Angular modules
'ngAnimate', // animations
'ngRoute' // routing
// Custom modules
// 3rd Party Modules
]);
// Execute bootstrapping code and any dependencies.
demoApp.run(['$rootScope',
function ($rootScope) {
}]);
})();
You can test XHR calls using the REST Client
CMD SHIFT A
- Type
RESTful
- Select
Test RESTful Web Service
Enter a new XHR request in the newly opened dialog
Strip trailing whitespace at the end of lines when saving a file.
CMD SHIFT A
and enterstrip
- Select
strip trailing spaces on save
- Scroll down to the
Other
section - Select when to strip the trailing spaces as
modified lines
or onall
files
http://openmymind.net/mongodb.pdf
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/
Allow users to read the the database
sudo chown
id -u /data/db
- Enter
CMD + SHIFT + A
- Type
plugin
- Select
Plugins
- Search for
mongo
- Install the
Mongo Plugin
This creates a menu option under Tools called Start MongoDB
- Enter
CMD + SHIFT + A
- Type
Configure Tools
- Press
+
to add a new tool - Name it
Start MongoDB
and give it a description - Under Options, only check the
Open console
- Show in
main menu
only - Under
Tools settings
- set the
Program
to/Users/johnpapa/mongodb/bin/mongod
or/usr/local/bin/mongod
(where it is located) - set
Parameters
to--config mongodb.config
- set
working directory
to/Users/johnpapa/mongodb/bin
- set the
#logpath=c:\mongodb\log\mongo.log
dbpath=/Users/johnpapa/mongodb/data
rest=true
- Enter
CMD + SHIFT + A
- Type
Edit Configurations
- Press
+
to add a new configuration - Select
node.js
- Name it
MEAN server
(or whatever) - Set the working directory to your project such as
/Users/johnpapa/_git/CC-Angular-Breeze/final/CC.Web
- Set the JavaScript file to start as the server
mean/server.js
- Make sure you have installed nodemon globally. if not, run
npm install -g nodemon
usingsudo
- Enter
CMD + SHIFT + A
- Type
Edit Configurations
- Press
+
to add a new configuration - Select
node.js
- Name it
MEAN server
(or whatever) - Set the
node parameters
to/usr/local/bin/nodemon
- Set the working directory to your project such as
/Users/johnpapa/_git/CC-Angular-Breeze/final/CC.Web
- Set the JavaScript file to start as the server
mean/server.js
- Enter
CMD + SHIFT + A
- Type
Edit Configurations
- Press
+
to add a new configuration - Select
node.js
- Name it
Grunt Build
- Set the working directory to your project such as
/Users/johnpapa/_git/CC-Angular-Breeze/final/build
- Set the JavaScript file to
/usr/local/lib/node_modules/grunt-cli/bin/grunt
- Set Application Parameters to the name of the grunt task such as
build
(only applicable to WebStorm 7, as this is built into WebStorm 8)
- Navigate to File->Settings->Plugins
- Click "Browse Repositories"
- Select "AngularJS"
- Double-click (or right-click) and, when prompted, choose "Yes"
- Restart WebStorm