chrisgrieser/nvim-various-textobjs

New Textobj: anyQuotation

magidc opened this issue · 3 comments

Textobj requested

Select a piece of text surrounded by a pair of quotes of any kind (' " `)
It would also useful to have another text object to select any kind of block (<>, {}, []...).
The purpose of such objects will be to be able to refer to context where the cursor is without having to specify the delimiter making possible to define keymaps such as "change quoted content".
Targets vim plugin already implement his objects any-quote, any-block but it is not possible to use it in keymaps.

Inner/Outer Difference

Inner wont include the quotes.

Vimscript plugin already implementing the textobj

https://github.com/wellle/targets.vim#any-quote

Filetypes

all

Checklist

  • The textobj would be useful to more users than just me.
  • There is no lua plugin already implementing the textobj in an adequate manner.
  • I read the docs and there is no such textobj already.

It's not well documented, but vim-matchup already has such a text object.

Thanks, it actually does the job. It does not distinguish between blocks and quoted contents but it is ok enough for me. Targets plugin has already these text objects but I could not manage to use them in mappings, that was my main problem. With matchup I could so I am satisfied enough, thx!

In case this is still relevant, I recently added an anyQuote and an anyBracket text object. (with the limitation that multi-line objects are not supported.)