Consider the below function definition:
def function(self, arg1, arg2):
"""Function for doing something.
Args:
arg1: Argument 1.
arg2: Argument 2.
Returns:
Returns something.
"""
...
...
What would the easiest way of selecting the whole docstring be? For example, I can easily select the inner and outer perimeters of a function using built-in square bracket mappings (i.e. [m or ]m), but what about the docstrings themselves? The best I can do now is using square-bracket mappings to jump to the beginning of a function definition, going down a line, then manually highlighting using visual-mode selection. Assuming my cursor is within the function block, this is how I would approach docstring selection:
[mto go to beginning of function definitionjto go down a lineVto go to line-wise visual mode{n}jto go down whatever the relative-line number of last"""is
Is there any way of making this easier? I think at least there must be some workaround for step 4 which can be quite tedious. Perhaps some pattern matching? g* for selection was an idea I had but it only works if the triple quotation marks are isolated in their own line.
[mand other "method" mappings. I find these to be very under utilized.