Skip to content
Discussion options

You must be logged in to vote

Let's say I have my cursor right before the closing ) and I want to add the missing (

func)

Right now, it ends up like

func())

I'd like to prevent autopairing if the next character is the closing one of the same pair. I tried to modify the neigh_pattern but not sure how to end up with the expected result

That would be something like this:

require('mini.pairs').setup({
  mappings = {
    -- Insert `()` if left character is not `\` and if right character is not `)`
    ['('] = { neigh_pattern = '[^\\][^)]' },
  },
})

But my genuine suggestion would be to press <C-v> before ( if you want to prevent it from inserting the whole pair.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
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.pairs
3 participants