Skip to content

Instantly share code, notes, and snippets.

@harthur
Created June 18, 2012 22:12
Show Gist options
  • Save harthur/2951063 to your computer and use it in GitHub Desktop.
Save harthur/2951063 to your computer and use it in GitHub Desktop.
console.log() key binding for Sublime Text

Go to Sublime Text 2 > Preferences > Key Bindings - User and add this JSON to the file:

[
    { "keys": ["super+shift+l"],
      "command": "insert_snippet",
      "args": {
        "contents": "console.log(${1:}$SELECTION);${0}"
      }
    }
]

Inserts a console.log() at the current cursor position, tab once to jump past.

@Avcajaraville
Copy link

Thanks !

@msman
Copy link

msman commented Mar 28, 2018

very cool

@totalBenjick
Copy link

how this works exactly? I have ubuntu in a Spanish keyboard

@samdutton
Copy link

This is great, but (as per previous reply) where are ${1:}, $SELECTION and ${0} documented?

@TimBrunsmo
Copy link

Works like a charm, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment