Skip to content

Instantly share code, notes, and snippets.

@jpetto
Last active October 20, 2017 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpetto/f6e28dc364aa3d0ceb499300aea8f022 to your computer and use it in GitHub Desktop.
Save jpetto/f6e28dc364aa3d0ceb499300aea8f022 to your computer and use it in GitHub Desktop.
VS Code keybindings for wrapping strings for L10n

Installation

  1. Open keyboard shortcuts (cmd+k, cmd+s on macOS)
  2. Click on the keybindings.json link at the top
  3. Add the objects in l10n-keybindings.json to the parent array

Usage

  1. Select some text and perform one of the key commands: cmd+shift+w or cmd+shift+t
{
"key": "cmd+shift+w",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"args": {
"snippet": "{{ _('${TM_SELECTED_TEXT}') }}"
}
},
{
"key": "cmd+shift+t",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"args": {
"snippet": "{% trans %}\n\t${TM_SELECTED_TEXT}\n{% endtrans %}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment