targets.vim icon indicating copy to clipboard operation
targets.vim copied to clipboard

Python docstring handling

Open yochem opened this issue 3 years ago • 0 comments

Hi maintainer(s) of targets.vim,

I just started using this plugin and loving it already. Works great! Because I use Python a lot, I wanted to extend the targets following this part of the project's readme to support Python docstrings. These docstrings look like this:

"""
This is a docstring.
"""

I've added this to my vimrc:

autocmd User targets#mappings#user call targets#mappings#extend({
    \ 'd': {'pair': [{'o': '"""\n', 'c': '"""'}]},
    \ })

This works perfect when the docstrings are oneliners:

"""This is an example."""  ---did---> """"""
"""This is an example."""  ---dad--->

But it doesn't work at all on multiline docstrings. It only deletes one double quote on the closing triplet. Is there are way to get this working? Or isn't it possible to add multiline support for triple quotes?

btw, it should work like, for example, parentheses on multiple lines:

(
example
)

using di( on this gives

(
)

and using da( on this also deletes the lines with parentheses.

yochem avatar Aug 18 '20 13:08 yochem