does webstorm have some shortcut for console.log or console.info

前端 未结 9 2055
野的像风
野的像风 2021-02-01 11:45

Just tired of typing console.log again and again, and do not find a way like \'Sysout + Control + Space\' in Eclipse will create System.out.println().

9条回答
  •  独厮守ぢ
    2021-02-01 12:32

    There's a predefined Postfix template that allows you to type .log after a JavaScript expression or string and hit Tab to transform it to console.log().

    You can also create a Live template (see Preferences | Editor | Live templates) that would expand into a code snippet once you type the selected abbreviation and hit Tab.

    Update: there's now also a plugin that allows you to add console.log with a shortcut: https://plugins.jetbrains.com/plugin/10986-console-log

提交回复
热议问题