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?
Th
Record a macro (untested)
qq " record macro to register q
o " insert empty line below cursor
esc " exit insert-mode
:r /path/to/binding.pry " insert content of file
esc " cmd-mode
q " end recording
To execute macro, do
@q
Or add the following to your .vimrc
file
update
To insert the string binding.pry
the mapping becomes:
map ,p obinding.pry