I often insert binding.pry
to my ruby files when I debug them. As I use Vim I'd love to automate it to avoid retyping it every time. How could I do it?
The exact sequence I'd like to map is:
- Insert new line.
- Insert
binding.pry
to the newly created line. - Return to normal mode.
EDIT: binding.pry
is text I want to paste, not a file.
Before insert:
a = 1
b = 2
After insert:
a = 1
binding.pry
b = 2