Because Atom will be deprecated quite soon I had to switch to vscode which is really nice after made some configuration setup. One thing is missing compared to my Atom setups - in Atom after I type pry enter
the binding.pry
shows up. Like below:
Atom pry
Atom enter
and we've got binding.pry
. I've no idea how it was made in Atom, is there any chance to get the same in VSCODE ?
CodePudding user response:
I tried many ways and I must create a custom snippet.
To create or edit your own snippets, select User Snippets
under File > Preferences
(Code > Preferences
on macOS
), and then select the language (by language identifier) for which the snippets should appear, or the New Global Snippets
file option if they should appear for all languages.
ref
Here is my snippet:
"Print to console": {
"prefix": "pry",
"body": [
"binding.pry",
],
"description": "Add binding for ruby code using gem pry"
}