Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shortcut for create javascript function on webstorm / intellij

I've seen on EggHead blog's some videos about coding AngularJS javascript apps. I realize that every time that he type $scope.x = fun the code completion open and he types some shortcut (which I don't know) that creates the following statement:

$scope.x = function () {
}

The normal code complete, ctrl + space, gives me:

$scope.x = function

Does anybody knows this shortcut or how to configure that?

like image 392
Deividi Cavarzan Avatar asked Dec 20 '22 02:12

Deividi Cavarzan


1 Answers

Most likely he has a custom Live Template configured that expands fun with Tab into:

function () {
}

The template may look like this:

function () {
  $END$
}

Where $END$ stands for the final cursor position after expanding.

like image 165
CrazyCoder Avatar answered Dec 26 '22 01:12

CrazyCoder