Open christoomey opened 8 years ago
I'd love this! Commonly I'm debugging code and I'd like to see what a particular variable evaluates to in my pry session. What I have to do now is yank the text and copy it to a new line. For example, if I want to know what's on_the_stove
:
binding.pry
if on_the_stove.include? :teapot
turn_on_teapot_burner
end
I need to yank the variable to a new line to send it:
binding.pry
on_the_stove # :VtrSendLinesTo
if on_the_stove.include? :teapot
turn_on_teapot_burner
end
Yep, I do very similar things all the time. Having a custom operator has been my plan for a while, I've just not found the time / felt the urgency to get it done.
Hi Chris,
I was able to get the Vim motion commands working with VTR :)
I have binded "\<leader>sm" as the trigger both in visual and normal modes. Do take a look.
There are minor things to clean-up:
For running python code correctly indentation is critical, so "g:VtrStripLeadingWhitespace" needs to be set to '0' for python programmers. We need to document it.
Prefer to combine VtrSendLinesToRunner with the VtrSendLinesWithMotion if possible. Currently, VtrSendLinesWithMotion does not support range commands. I was unable to figure that out.
I raised the PR, Let me know what you think.
Hi Chris,
Updating some of the key usages for reference and future documentation: Below, assume "\<leader>sm" is \<prefix>
Rather than requiring a full line or visually selected range, go big and make an custom operator for this. Then it would be possible to send portions of lines, paragraphs, etc. Embrace the Vim!