Skip to content
Discussion options

You must be logged in to vote

I'd suggest doing that through config.custom_textobjects and not via custom mappings. This way it is defined once per texotjbect id, no need for separate 'a'/'i'/'al'/'il'/'an'/'in' mappings. Custom textobjects should follow specification, but looking at how built-in textobjects are implemented should get 95% there for this case.

If I correctly understood what you're trying to achieve, the following setup should be all you need:

require('mini.ai').setup({
  custom_textobjects = {
    ['c'] = { '%b()', '^.().*().$' },
    ['C'] = { '%b()', '^.%s*().-()%s*.$' },
    ['B'] = { { '%b()', '%b[]', '%b{}' }, '^.%s*().-()%s*.$' },
  },
})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tuurep
Comment options

Answer selected by echasnovski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested mini.ai
2 participants