RubyMine 7.0.1 Web Help

Simple Live Templates

A Simple template contains some fixed code that expands into plain text. When invoked and expanded in the editor, the code specified in the template is automatically inserted into your source code, replacing the abbreviation.

Parameterized Live Templates

A Parameterized template contains plain text and variables that enable user input.

Tip

If you need a dollar sign ($) in the template text, escape it by duplicating this character ($$).

After a template is expanded, variables appear in the editor as input fields whose values can be either filled in by the user or calculated by RubyMine automatically.

Surround Live Templates

Surround templates work only with blocks of selected text. Such templates place code before and after the selected block.

Examples

Insert parameterized live template (Ctrl+JCtrl+JCtrl+JCtrl+JCtrl+JCtrl+JCtrl+JCtrl+Shift+Alt+J⌘+J⌘ J⌘ J⌘ J⌘ J):

Surround with live template (Ctrl+Alt+JCtrl+Alt+JCtrl+Alt+JCtrl+Alt+JCtrl+Alt+JCtrl+Alt+JCtrl+Alt+JCtrl+Alt+JAlt+⌘+JAlt ⌘ JAlt ⌘ JAlt ⌘ JAlt ⌘ J):

html_surround_with_live_template


Refer also to the page Wrapping a Tag. Example of Applying Surround Live Templates.

Cucumber feature:

ruby_featureLiveTemplate.png

Rails has_many relationship:

ruby_liveTemplateHasMany.png

See Also

Procedures:

Reference:

Web Resources: