vim-textobj-python
vim-textobj-python copied to clipboard
Add object for an entire function call
In case I have a function call defined across multiple lines, is there any mapping to select the entire call? Otherwise, I would like to have such a text object.
Can you provide an example? If it's something like
foo(bar,
baz,
quux)
how about doing e.g. va)ob
within the parens to get a visual selection?
Yes, that's the case. That is just a horribly long shortcut and to my mind it would make sense to have something language-specific inside here. Also for people to actually find the right shortcut ;)
Oh, and additionally, this doesn't work if there is an embedded function call. I might end up selecting only that one.
Yeah, you're screwed if you have embedded function calls. This is also the reason why it's not possible to do it right with regular expressions. :smile:
I'm not sure I've needed this. I'm open to taking a patch, but I think the current kludgy approach the rest of the plugin uses isn't going to apply.
Have you looked at https://github.com/terryma/vim-expand-region for doing something similar? It's a more general approach?
I didn't look at expand-region so far.
I am using this to send portions of code to ipython using vim-slime. And since I often have to reuse certain lines of code for experimentation, such a feature would be very handy.