I am currently using WebStorm for dev, so I want to know is it possible to insert an exact live template using keymap shortcut in WebStorm ?
For example:
- Select a variable;
- Then press Ctrl + L, it will inset a template code to next line.
Like this one in VS Code:VS Code gif example
I know some usage like .log
, but seems it will break the original code and it not what I expecting.
And I also found a plugin called logit
accroding to this post, but it seems just can insert one pattern, not so 'customize'.
AFAIK I can implement this in VSCode like this below:
// keybindings.json{"key": "ctrl+l","command": "runCommands","when": "editorHasSelection && editorTextFocus && !editorReadonly","args": {"commands": ["editor.action.clipboardCopyAction","editor.action.insertLineAfter", {"command": "editor.action.insertSnippet","args": {"snippet": "console.log('${1:$CLIPBOARD} :>>', ${1:$CLIPBOARD});" } } ] }}