maephisto
maephisto

Reputation: 5182

how to define code shortcut in webstorm IDE?

Is it possible to define "shortcuts" to use with Webstorm something like below?
Example: pressing Shift + C + L would then insert at cursor position a "console.log()"

Upvotes: 2

Views: 795

Answers (2)

Franz Anton Mesmer
Franz Anton Mesmer

Reputation: 57

In Webstorm: 1.Type Ctrl+Alt+S. You are in preferences.

2.Type Live Templates

3.Type +

Create new group. Then create template there:

console.log($END$)

and chose any abrevation you want cl for example

Upvotes: 2

LazyOne
LazyOne

Reputation: 165148

You can use existing Live Templates functionality (code snippets) to have cl[TAB] (for example) to be expanded into console.log(CURSOR_HERE);

If you need actual dedicated keyboard shortcut ... then I may only suggest to record a macro that types such text and assign shortcut to it.

Upvotes: 2

Related Questions