IntelliJ IDEA
IntelliJ IDEA – the Leading Java and Kotlin IDE, by JetBrains
Live Templates in JavaScript/ActionScript/Flex
Writing JavaScript/ActionScript/Flex code becomes easier with IntelliJ IDEA 9.0.2. New set of live templates (see Settings dialog (Ctrl+Alt+S), Live Templates, JavaScript/ActionScript group), allows to avoid tedious typing when you need to define a function, variable or constant, to loop over an Array, Vector or anything else. Luckily, some abbreviations are the same as with Java: iter, itar, ritar. Here’s the list of currently available live templates:
Abbreviation | Description |
---|---|
iter | Iterate (for each..in) |
itin | Iterate (for..in) |
itar | Iterate elements of array |
ritar | Iterate elements of array in reverse order |
pf | public function |
prf | private function |
psf | public static function |
prsf | private static function |
pv | public var |
prv | private var |
psv | public static var |
prsv | private static var |
pc | public const |
prc | private const |
psc | public static const |
prsc | private static const |
To use a live template, just type its abbreviation anywhere in your code and press Tab. Here are some examples:
Ctrl+J shortcut shows you all live templates available for current context.
Also you may add your own live templates at Settings (Ctrl+Alt+S), Live Templates page.