1

How can I insert code in Visual Studio Code for MacOS with key bindings? For example in Sublime I can insert a console.log like this:

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

If I press Cmd+Shift+L I get console.log('test:' + varname);

1 Answer 1

4

You can specify what the insertSnippet command should insert like this:

{
    "key": "cmd+shift+l",
    "command": "editor.action.insertSnippet",
    "args": {
       "snippet": "console.log('test:' + varname);${0}"
    }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.