This plugin defines a multiline-str text object for the vim-textobj-user plugin.
With vim-plug:
Plug 'kana/vim-textobj-user' | Plug 'thalesmello/vim-textobj-multiline-str'
For Python files:
aq
: around multiline string. Gets the string contents and the quotes.iq
: inner multiline string. Gets the string contents without the quotes and immediate linebreaks.
call textobj#user#map('multilinestr', {
\ 'python': {
\ 'select-a': 'a`',
\ 'select-i': 'i`',
\ }
\ })
let g:textobj_multilinestr_no_default_key_mappings = 1
For more details, look at the vim-textobj-user documentation.