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().
I'm including what I find to be the most efficient, which I added via live templates -> javascript -> applicable to "Everything". Hopefully someone finds it useful.
console.log('L$LINE$ $MYSTRING$ ===', $MYVAR$);$END$
What it does:
When I type cl
and press tab, it creates the log and the first thing you type fills both MYSTRING
and MYVAR
variables. If you tab again, it selects MYVAR
where you can rewrite/delete as desired. The third time you hit tab will take you to the end of the line at $END
.
This snippet also prints the line number like L123
but you can easily remove that if it isn't helpful because obviously most browsers show line number anyway.
You also have to set the variables' behaviour as seen in the image below:
Edit variables setup