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

前端 未结 9 2054
野的像风
野的像风 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:36

    use Macros!

    https://www.jetbrains.com/help/webstorm/using-macros-in-the-editor.html

    I recorded a macro that takes the name my cursor is on and create

    console.log("#### name = ", name);

    on the next line. and assigned a keyboard shortcut to it :)

    super easy, and couldn't get Live Template to get the same result with 1 action.

    to create a new macro: Edit -> Macros -> Start Macro Recording. then record your next moves and create the desired result. this is mine:

提交回复
热议问题